summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorredman <redman@noemail.net>1999-05-26 20:24:43 (GMT)
committerredman <redman@noemail.net>1999-05-26 20:24:43 (GMT)
commit3284b1c1ef928c5cd17e1d3f81e6547d911ca0f3 (patch)
tree8ccfaadf0fc8865e7c3808ab15f1328fae208b05 /generic
parent1338397dbdc94a71ad7144dc3442fbc5f6e790ca (diff)
downloadtcl-3284b1c1ef928c5cd17e1d3f81e6547d911ca0f3.zip
tcl-3284b1c1ef928c5cd17e1d3f81e6547d911ca0f3.tar.gz
tcl-3284b1c1ef928c5cd17e1d3f81e6547d911ca0f3.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. FossilOrigin-Name: b14f0363ecd8d934bd5a695c50d18bd480009c43
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);
}