Skip to content
  • Stan Hu's avatar
    65fed1c3
    Allow waitpid(-1, Process::WNOHANG) to be woken if a waitpid(pid) is · 65fed1c3
    Stan Hu authored
    ...pending
    
    If two threads are running, with one calling waitpid(-1, Process::WNOHANG),
    and another calling waitpid($some_pid), and then
    $some_other_pid exits, we would expect the waitpid(-1,
    Process::WNOHANG) call to retrieve that exit status. However, it
    cannot actually do so until $some_pid _also_ exits.
    
    This patch fixes the issue by calling do_waitpid unconditionally in
    waitpid_wait; this will ensure that a waitpid -1 actually reaps
    something (after first checking that no PID-directed call wants the
    process).
    
    [Bug #20490]
    65fed1c3
    Allow waitpid(-1, Process::WNOHANG) to be woken if a waitpid(pid) is
    Stan Hu authored
    ...pending
    
    If two threads are running, with one calling waitpid(-1, Process::WNOHANG),
    and another calling waitpid($some_pid), and then
    $some_other_pid exits, we would expect the waitpid(-1,
    Process::WNOHANG) call to retrieve that exit status. However, it
    cannot actually do so until $some_pid _also_ exits.
    
    This patch fixes the issue by calling do_waitpid unconditionally in
    waitpid_wait; this will ensure that a waitpid -1 actually reaps
    something (after first checking that no PID-directed call wants the
    process).
    
    [Bug #20490]
Loading