mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 11:12:27 +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
|
@ -67,7 +67,7 @@ textwindows int sys_accept_nt(struct Fd *fd, struct sockaddr_storage *addr,
|
|||
if (!AcceptEx(fd->handle, handle, &buffer, 0, sizeof(buffer.local),
|
||||
sizeof(buffer.remote), &bytes_received, &overlapped)) {
|
||||
sockfd = (struct SockFd *)fd->extra;
|
||||
if (__wsablock(fd, &overlapped, &completion_flags, true,
|
||||
if (__wsablock(fd, &overlapped, &completion_flags, kSigOpRestartable,
|
||||
sockfd->rcvtimeo) == -1) {
|
||||
WSACloseEvent(overlapped.hEvent);
|
||||
__sys_closesocket_nt(handle);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue