diff options
Diffstat (limited to 'lib/sockets.c')
-rw-r--r-- | lib/sockets.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sockets.c b/lib/sockets.c index 25ab97f3d..432f3b584 100644 --- a/lib/sockets.c +++ b/lib/sockets.c @@ -37,6 +37,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; |