mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-26 22:38:30 +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
2
third_party/nsync/futex.c
vendored
2
third_party/nsync/futex.c
vendored
|
@ -174,7 +174,7 @@ static int nsync_futex_wait_win32_ (atomic_int *w, int expect, char pshare, stru
|
|||
deadline = timespec_max;
|
||||
}
|
||||
|
||||
while (!(rc = _check_interrupts (false, 0))) {
|
||||
while (!(rc = _check_interrupts (0, 0))) {
|
||||
now = timespec_real ();
|
||||
if (timespec_cmp (now, deadline) > 0) {
|
||||
rc = etimedout();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue