• Oleg Nesterov's avatar
    signal: do_sigtimedwait() needs retarget_shared_pending() · b182801a
    Oleg Nesterov authored
    do_sigtimedwait() changes current->blocked and thus it needs
    set_current_blocked()->retarget_shared_pending().
    
    We could use set_current_blocked() directly. It is fine to change
    ->real_blocked from all-zeroes to ->blocked and vice versa lockless,
    but this is not immediately clear, looks racy, and needs a huge
    comment to explain why this is correct.
    
    To keep the things simple this patch adds the new static helper,
    __set_task_blocked() which should be called with ->siglock held. This
    way we can change both ->real_blocked and ->blocked atomically under
    ->siglock as the current code does. This is more understandable.
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Acked-by: default avatarTejun Heo <tj@kernel.org>
    Reviewed-by: default avatarMatt Fleming <matt.fleming@linux.intel.com>
    b182801a
signal.c 79.3 KB