X-Git-Url: http://git.hcoop.net/bpt/guile.git/blobdiff_plain/dd7d0148f221c3180ab6f31c8742aaf4d0e5926a..c2c2b5a49b1ce37a42417037c3515864a808e53b:/lib/sockets.c diff --git a/lib/sockets.c b/lib/sockets.c index 25ab97f3d..843d99283 100644 --- a/lib/sockets.c +++ b/lib/sockets.c @@ -28,6 +28,7 @@ # include # include "fd-hook.h" +# include "msvc-nothrow.h" /* Get set_winsock_errno, FD_TO_SOCKET etc. */ # include "w32sock.h" @@ -37,6 +38,10 @@ close_fd_maybe_socket (const struct fd_hook *remaining_list, gl_close_fn primary, int fd) { + /* Note about multithread-safety: There is a race condition where, between + our calls to closesocket() and the primary close(), some other thread + could make system calls that allocate precisely the same HANDLE value + as sock; then the primary close() would call CloseHandle() on it. */ SOCKET sock; WSANETWORKEVENTS ev;