cygwin: cleanup fhandler_socket::release_events

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2017-11-27 13:38:21 +01:00
parent 569d048c89
commit 9789cdffde

View File

@ -801,14 +801,16 @@ fhandler_socket::wait_for_events (const long event_mask, const DWORD flags)
void void
fhandler_socket::release_events () fhandler_socket::release_events ()
{ {
HANDLE evt = wsock_evt; if (WaitForSingleObject (wsock_mtx, INFINITE) != WAIT_FAILED)
HANDLE mtx = wsock_mtx; {
HANDLE evt = wsock_evt;
HANDLE mtx = wsock_mtx;
LOCK_EVENTS; wsock_evt = wsock_mtx = NULL;
wsock_evt = wsock_mtx = NULL; ReleaseMutex (mtx);
} ReleaseMutex (mtx); /* == UNLOCK_EVENTS, but note using local mtx here. */ NtClose (evt);
NtClose (evt); NtClose (mtx);
NtClose (mtx); }
} }
/* Called from net.cc:fdsock() if a freshly created socket is not /* Called from net.cc:fdsock() if a freshly created socket is not