File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -706,7 +706,7 @@ ThreadEvalObjCmd(
706706 }
707707
708708 /*
709- * Find out wether to use the internal (recursive) mutex
709+ * Find out whether to use the internal (recursive) mutex
710710 * or external mutex given on the command line, and lock
711711 * the corresponding mutex immediately.
712712 *
@@ -733,11 +733,13 @@ ThreadEvalObjCmd(
733733 return TCL_ERROR ;
734734 }
735735 if (IsReadWrite (mutexPtr )) {
736+ PutMutex (mutexPtr );
736737 Tcl_AppendResult (interp , "wrong mutex type, must be exclusive "
737738 "or recursive" , (void * )NULL );
738739 return TCL_ERROR ;
739740 }
740741 if (!SpMutexLock (mutexPtr )) {
742+ PutMutex (mutexPtr );
741743 Tcl_AppendResult (interp , "locking the same exclusive mutex "
742744 "twice from the same thread" , (void * )NULL );
743745 return TCL_ERROR ;
@@ -777,6 +779,7 @@ ThreadEvalObjCmd(
777779 Sp_RecursiveMutexUnlock (& evalMutex );
778780 } else {
779781 SpMutexUnlock (mutexPtr );
782+ PutMutex (mutexPtr );
780783 }
781784
782785 return ret ;
Original file line number Diff line number Diff line change @@ -1267,7 +1267,7 @@ test thread-bug-f32864afe3 {Hang in thread::eval -lock} -body {
12671267 set mu [thread::mutex create]
12681268 thread::eval -lock $mu {}
12691269 thread::mutex destroy $mu ; # <- Bug f32864af hang
1270- } -result {} -constraints bug-f32864afe3
1270+ } -result {}
12711271
12721272removeFile dummyForTransfer
12731273::tcltest::cleanupTests
You can’t perform that action at this time.
0 commit comments