diff options
author | dgp <dgp@users.sourceforge.net> | 2012-11-07 17:24:12 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-11-07 17:24:12 (GMT) |
commit | ba16c7a4403b1fa99daafb9292751bf572c09616 (patch) | |
tree | 06ae563ede46ef35f44a42ae7397acb4bb0b2846 /win/tclWinSock.c | |
parent | 188bfaf1aed5fe7441748433f69ccfe434c841f3 (diff) | |
download | tcl-ba16c7a4403b1fa99daafb9292751bf572c09616.zip tcl-ba16c7a4403b1fa99daafb9292751bf572c09616.tar.gz tcl-ba16c7a4403b1fa99daafb9292751bf572c09616.tar.bz2 |
3574493 Avoid hanging on exit due to use of synchronization calls in
routines called by DllMain().
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r-- | win/tclWinSock.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 328198b..050564d 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -659,12 +659,13 @@ TclpFinalizeSockets() if (tsdPtr != NULL) { if (tsdPtr->socketThread != NULL) { if (tsdPtr->hwnd != NULL) { - PostMessage(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0); - /* - * Wait for the thread to exit. This ensures that we are - * completely cleaned up before we leave this function. - */ - WaitForSingleObject(tsdPtr->readyEvent, INFINITE); + if (PostMessage(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0)) { + /* + * Wait for the thread to exit. This ensures that we are + * completely cleaned up before we leave this function. + */ + WaitForSingleObject(tsdPtr->readyEvent, INFINITE); + } tsdPtr->hwnd = NULL; } CloseHandle(tsdPtr->socketThread); |