diff options
author | ferrieux <ferrieux@users.sourceforge.net> | 2012-07-19 17:36:59 (GMT) |
---|---|---|
committer | ferrieux <ferrieux@users.sourceforge.net> | 2012-07-19 17:36:59 (GMT) |
commit | 30d6749651567f00c44c014361435942165bf372 (patch) | |
tree | b2b1ff030914dfb759b80e46243403211b5a9496 /generic | |
parent | ce1d17821fa4d5f332ec9806f0c525d1241a8354 (diff) | |
download | tcl-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.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclTest.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |