Fix hang in syncio_close (#763)

This commit is contained in:
Andrew 2024-12-18 12:36:43 -08:00 committed by GitHub
parent 265df19787
commit 0c3137f621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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 */