diff options
author | dgp <dgp@users.sourceforge.net> | 2012-11-07 17:26:48 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-11-07 17:26:48 (GMT) |
commit | 0ce2fecd2b2d28ee566c44ec370513b1dae22db7 (patch) | |
tree | e98febf106290ca820edd5a8656d86fde19d2b53 | |
parent | c3b4a2a0f7b1819ef8e2dc310cc672d564e2bbbf (diff) | |
parent | ba16c7a4403b1fa99daafb9292751bf572c09616 (diff) | |
download | tcl-0ce2fecd2b2d28ee566c44ec370513b1dae22db7.zip tcl-0ce2fecd2b2d28ee566c44ec370513b1dae22db7.tar.gz tcl-0ce2fecd2b2d28ee566c44ec370513b1dae22db7.tar.bz2 |
3574493 Avoid hanging on exit due to use of synchronization calls in
routines called by DllMain().
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win/tclWinSock.c | 15 |
2 files changed, 12 insertions, 8 deletions
@@ -1,3 +1,8 @@ +2012-11-07 Don Porter <dgp@users.sourceforge.net> + + * win/tclWinSock.c: [Bug 3574493] Avoid hanging on exit due to + use of synchronization calls in routines called by DllMain(). + 2012-11-06 Donal K. Fellows <dkf@users.sf.net> * library/http/http.tcl (http::Finish): [Bug 3581754]: Ensure that diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 8f2028d..9fa01c9 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -460,14 +460,13 @@ TclpFinalizeSockets(void) 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); |