mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Make forking off threads reliable on Windows
This change makes posix_spawn_test no longer flaky on Windows, by (1) fixing a race condition in wait(), and (2) removing a misguided vfork implementation which was letting Windows bypass pthread_atfork().
This commit is contained in:
parent
2ebc5781a1
commit
58352df0a4
30 changed files with 230 additions and 187 deletions
|
@ -55,7 +55,9 @@ int wait4(int pid, int *opt_out_wstatus, int options,
|
|||
} else {
|
||||
rc = sys_wait4_nt(pid, &ws, options, opt_out_rusage);
|
||||
}
|
||||
if (rc != -1 && opt_out_wstatus) *opt_out_wstatus = ws;
|
||||
if (rc != -1 && opt_out_wstatus) {
|
||||
*opt_out_wstatus = ws;
|
||||
}
|
||||
|
||||
END_CANCELLATION_POINT;
|
||||
STRACE("wait4(%d, [%#x], %d, %p) → %d% m", pid, ws, options, opt_out_rusage,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue