diff options
| author | Stan Hu <stanhu@gmail.com> | 2024-05-17 17:05:48 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2024-08-18 18:02:09 +0900 |
| commit | 65fed1c3e439bc47bcf6ec884431a86cb9ebd1dc (patch) | |
| tree | 236e877de69232fc2b0adc30bf959d680b8eac46 /test/ruby/test_whileuntil.rb | |
| parent | 50399eebd96c76ce808ea4d84fe39693f585a531 (diff) | |
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]
Diffstat (limited to 'test/ruby/test_whileuntil.rb')
0 files changed, 0 insertions, 0 deletions
