• Rusty Russell's avatar
    [PATCH] Remove Futex Warning · e5f39047
    Rusty Russell authored
    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: default avatarRusty Russell <rusty@rustcorp.com.au>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    e5f39047
futex.c 18.6 KB