summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorredman <redman>1999-05-26 20:24:43 (GMT)
committerredman <redman>1999-05-26 20:24:43 (GMT)
commit6cd14bf5542b934b1b15131087e58f92da9f8a93 (patch)
tree8ccfaadf0fc8865e7c3808ab15f1328fae208b05 /generic
parent9b8d0c42d5220c0fe2e393876c547cc86592439b (diff)
downloadtcl-6cd14bf5542b934b1b15131087e58f92da9f8a93.zip
tcl-6cd14bf5542b934b1b15131087e58f92da9f8a93.tar.gz
tcl-6cd14bf5542b934b1b15131087e58f92da9f8a93.tar.bz2
generic/tclThreadTest.c: Fix race condition in testthread code.
win/tclWinSock.c: Fixed hang in WinNT socket driver, now wakes up the socket thread to check for events that didn't trigger the WSAEvent.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclThreadTest.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index 0acba19..c24b059 100644
--- a/generic/tclThreadTest.c
+++ b/generic/tclThreadTest.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclThreadTest.c,v 1.2 1999/04/16 00:46:54 stanton Exp $
+ * RCS: @(#) $Id: tclThreadTest.c,v 1.3 1999/05/26 20:24:43 redman Exp $
*/
#include "tclInt.h"
@@ -713,10 +713,10 @@ TclThreadSend(interp, id, script, wait)
threadEventPtr->event.proc = ThreadEventProc;
Tcl_ThreadQueueEvent(threadId, (Tcl_Event *)threadEventPtr,
TCL_QUEUE_TAIL);
- Tcl_MutexUnlock(&threadMutex);
Tcl_ThreadAlert(threadId);
if (!wait) {
+ Tcl_MutexUnlock(&threadMutex);
return TCL_OK;
}
@@ -725,7 +725,6 @@ TclThreadSend(interp, id, script, wait)
*/
Tcl_ResetResult(interp);
- Tcl_MutexLock(&threadMutex);
while (resultPtr->result == NULL) {
Tcl_ConditionWait(&resultPtr->done, &threadMutex, NULL);
}