]> git.neil.brown.name Git - history.git/commit
[PATCH] Remove Futex Warning
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 29 Nov 2004 12:24:39 +0000 (04:24 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 29 Nov 2004 12:24:39 +0000 (04:24 -0800)
commite5f39047bfa57e93d5bf6657823c909dfd5c7564
tree197eca1ca1517df60ac26123626e602b4978257b
parent7f357f99380cf5927ddd66e49d2ebc23f19814eb
[PATCH] Remove Futex Warning

If we're waiting on a futex and we are woken up, it's either because
someone did FUTEX_WAKE, we timed out, or have been signalled.  However, the
WARN_ON(!signal_pending(current)) test is overzealous: with threads (a
common use of futexes), we share the signal handler and the other
thread might get to the signal before us.  In addition, exit_notify()
can do a recalc_sigpending_tsk() on us, which will then clear our
TIF_SIGPENDING bit, making signal_pending(current) return false.

Returning EINTR is a little strange in this case, since this thread
hasn't handled a signal.  However, with threads it's the best we can
do: there's always a race where another thread could have been the
actual one to handle the signal.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/futex.c