summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2012-07-20 01:47:48 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2012-07-20 01:47:48 (GMT)
commitb21d13ee199f28daaeb3a66120cdd34791b860da (patch)
treef56e071d117de17b2a8e4fe2268267a267a4fe2e /generic
parent3c3496770b84df1308f6cbd90ced02d636cedc04 (diff)
downloadtcl-b21d13ee199f28daaeb3a66120cdd34791b860da.zip
tcl-b21d13ee199f28daaeb3a66120cdd34791b860da.tar.gz
tcl-b21d13ee199f28daaeb3a66120cdd34791b860da.tar.bz2
Fix several more missing mutex-locks in TestasyncCmd.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclTest.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 56ea232..8dd315f 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -863,6 +863,7 @@ TestasyncCmd(
|| (Tcl_GetInt(interp, argv[4], &code) != TCL_OK)) {
return TCL_ERROR;
}
+ Tcl_MutexLock(&asyncTestMutex);
for (asyncPtr = firstHandler; asyncPtr != NULL;
asyncPtr = asyncPtr->nextPtr) {
if (asyncPtr->id == id) {
@@ -870,6 +871,7 @@ TestasyncCmd(
break;
}
}
+ Tcl_MutexUnlock(&asyncTestMutex);
Tcl_SetResult(interp, (char *)argv[3], TCL_VOLATILE);
return code;
#ifdef TCL_THREADS
@@ -880,6 +882,7 @@ TestasyncCmd(
if (Tcl_GetInt(interp, argv[2], &id) != TCL_OK) {
return TCL_ERROR;
}
+ Tcl_MutexLock(&asyncTestMutex);
for (asyncPtr = firstHandler; asyncPtr != NULL;
asyncPtr = asyncPtr->nextPtr) {
if (asyncPtr->id == id) {
@@ -888,11 +891,13 @@ TestasyncCmd(
(ClientData) INT2PTR(id), TCL_THREAD_STACK_DEFAULT,
TCL_THREAD_NOFLAGS) != TCL_OK) {
Tcl_SetResult(interp, "can't create thread", TCL_STATIC);
+ Tcl_MutexUnlock(&asyncTestMutex);
return TCL_ERROR;
}
break;
}
}
+ Tcl_MutexUnlock(&asyncTestMutex);
} else {
Tcl_AppendResult(interp, "bad option \"", argv[1],
"\": must be create, delete, int, mark, or marklater", NULL);