Fix hang in syncio_close

This commit is contained in:
Andrew 2024-11-14 13:56:24 -08:00
parent a915f06c78
commit 63053578bb

View File

@ -293,7 +293,10 @@ syncio_close(struct w32_io* pio)
CancelSynchronousIo(pio->read_overlapped.hEvent);
}
WaitForSingleObject(pio->read_overlapped.hEvent, INFINITE);
// give the read thread some time to wind down, but don't block syncio_close
if (WAIT_TIMEOUT == WaitForSingleObject(pio->read_overlapped.hEvent, 1000)) {
debug4("read_overlapped thread timed out");
}
}
/* drain queued APCs */