Skip to content
  • KJ Tsanaktsidis's avatar
    c08fdc68
    Allow waitpid(-1) to be woken if a waitpid(pid) call is pending · c08fdc68
    KJ Tsanaktsidis authored
    If two threads are running, with one calling waitpid(-1), and another
    calling waitpid($some_pid), and then $some_other_pid exits, we would
    expect the waitpid(-1) call to retrieve that exit status; however, it
    cannot actually do so until $some_pid _also_ exits.
    
    This patch fixes the issue by unconditionally checking for pending
    process group waits on SIGCHLD, and then allowing pending pid-only waits
    to "steal" the notification.
    
    [Fixes #19387]
    c08fdc68
    Allow waitpid(-1) to be woken if a waitpid(pid) call is pending
    KJ Tsanaktsidis authored
    If two threads are running, with one calling waitpid(-1), and another
    calling waitpid($some_pid), and then $some_other_pid exits, we would
    expect the waitpid(-1) call to retrieve that exit status; however, it
    cannot actually do so until $some_pid _also_ exits.
    
    This patch fixes the issue by unconditionally checking for pending
    process group waits on SIGCHLD, and then allowing pending pid-only waits
    to "steal" the notification.
    
    [Fixes #19387]
Loading