Project

General

Profile

« Previous | Next » 

Revision 65fed1c3

Added by stanhu (Stan Hu) about 1 year ago

Allow waitpid(-1, Process::WNOHANG) to be woken if a waitpid(pid) is

...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]