diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2004-11-29 04:24:39 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-29 04:24:39 -0800 |
commit | e5f39047bfa57e93d5bf6657823c909dfd5c7564 (patch) | |
tree | 197eca1ca1517df60ac26123626e602b4978257b /kernel | |
parent | 7f357f99380cf5927ddd66e49d2ebc23f19814eb (diff) | |
download | history-e5f39047bfa57e93d5bf6657823c909dfd5c7564.tar.gz |
[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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/futex.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index fc9b739e675cd6..645a4301f1e60f 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -553,8 +553,8 @@ static int futex_wait(unsigned long uaddr, int val, unsigned long time) return 0; if (time == 0) return -ETIMEDOUT; - /* A spurious wakeup should never happen. */ - WARN_ON(!signal_pending(current)); + /* We expect signal_pending(current), but another thread may + * have handled it for us already. */ return -EINTR; out_unqueue: |