summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorferrieux <ferrieux@users.sourceforge.net>2012-07-19 17:36:59 (GMT)
committerferrieux <ferrieux@users.sourceforge.net>2012-07-19 17:36:59 (GMT)
commit30d6749651567f00c44c014361435942165bf372 (patch)
treeb2b1ff030914dfb759b80e46243403211b5a9496
parentce1d17821fa4d5f332ec9806f0c525d1241a8354 (diff)
downloadtcl-30d6749651567f00c44c014361435942165bf372.zip
tcl-30d6749651567f00c44c014361435942165bf372.tar.gz
tcl-30d6749651567f00c44c014361435942165bf372.tar.bz2
[Bug 3544685]: Missing mutex-lock in TestasyncCmd since 2011-08-19. Unbounded gratitude to Stuart Cassoff for spotting it.
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclTest.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9545bc9..2f4b307 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-19 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
+
+ * generic/tclTest.c: [Bug 3544685]: Missing mutex-lock in
+ TestasyncCmd since 2011-08-19. Unbounded gratitude to Stuart
+ Cassoff for spotting it.
+
2012-07-17 Jan Nijtmans <nijtmans@users.sf.net>
* win/makefile.vc: [Bug 3544932]: Visual studio compiler check fails
diff --git a/generic/tclTest.c b/generic/tclTest.c
index ab0c6cb..56ea232 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -821,6 +821,7 @@ TestasyncCmd(
Tcl_SetResult(interp, buf, TCL_VOLATILE);
} else if (strcmp(argv[1], "delete") == 0) {
if (argc == 2) {
+ Tcl_MutexLock(&asyncTestMutex);
while (firstHandler != NULL) {
asyncPtr = firstHandler;
firstHandler = asyncPtr->nextPtr;
@@ -828,6 +829,7 @@ TestasyncCmd(
ckfree(asyncPtr->command);
ckfree((char *) asyncPtr);
}
+ Tcl_MutexUnlock(&asyncTestMutex);
return TCL_OK;
}
if (argc != 3) {
@@ -836,6 +838,7 @@ TestasyncCmd(
if (Tcl_GetInt(interp, argv[2], &id) != TCL_OK) {
return TCL_ERROR;
}
+ Tcl_MutexLock(&asyncTestMutex);
for (prevPtr = NULL, asyncPtr = firstHandler; asyncPtr != NULL;
prevPtr = asyncPtr, asyncPtr = asyncPtr->nextPtr) {
if (asyncPtr->id != id) {