diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclTest.c | 5 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2012-07-19 Joe Mistachkin <joe@mistachkin.com> + + * generic/tclTest.c: Fix several more missing mutex-locks in + TestasyncCmd. + 2012-07-19 Alexandre Ferrieux <ferrieux@users.sourceforge.net> * generic/tclTest.c: [Bug 3544685]: Missing mutex-lock in 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); |