Overview
| Artifact ID: | 139688c27bf8868d9472f34965d82199f353f3d9 |
|---|---|
| Ticket: | 1437595fffffffffffffffffffffffffffffffff
WinSock cores/hangs on thread or app exit |
| User & Date: | dunkfan on 2006-09-29 18:28:08 |
Changes
- icomment:
Logged In: YES user_id=1183601 FWIW I had a hanging problem with 8.4.13 XPSP2 after calling exit. Tracked it down to tclwinsock.c WaitForSingleObject(tsdPtr- >readyEvent, INFINITE); in the TclpFinalizeSockets() code... Then I included the code which used to be in there (from 8.4.6) to check whether the thread was STILL_ACTIVE before jumping into the Wait call. DWORD exitCode; GetExitCodeThread(tsdPtr->socketThread, &exitCode); if (exitCode == STILL_ACTIVE) { 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); tsdPtr->hwnd = NULL; } } That seems to cure the problem... - login: "dunkfan"
- mimetype: "text/plain"
- username: "dunkfan"