Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid race codition when setting process exit code on Windows.
A Perl program using fork() emulation on Windows may end up kill()ing the forked child and exiting immediately. There is a race condition where the process exit code may be changed to '9' (the signal used to kill the child thread), overriding the value the parent thread used in ExitProcess() (called implicitly with the return value of main()). Giving up the remainder of the time-slice after terminating a child thread seems to eliminate this race. This bug is responsible for various CPAN test failures, where all tests seem to pass, but Test::Harness still reports: "Dubious, test returned 9 (wstat 2304, 0x900)" (e.g. HTTP-Server-Simple, tests based on Test-TCP). See also https://rt.cpan.org/Ticket/Display.html?id=66016#txn-908976
- Loading branch information