diff options
author | vasiljevic <vasiljevic@noemail.net> | 2007-11-26 14:05:07 (GMT) |
---|---|---|
committer | vasiljevic <vasiljevic@noemail.net> | 2007-11-26 14:05:07 (GMT) |
commit | 8ca74da02ac96b8f4812546e1d94ab17542a2a13 (patch) | |
tree | 79cda80ca5c4f12245fd489b3901e5007d44e786 /generic/tclThread.c | |
parent | 8bc642da8cda303ab290bdb9712e6b865b4b3da4 (diff) | |
download | tcl-8ca74da02ac96b8f4812546e1d94ab17542a2a13.zip tcl-8ca74da02ac96b8f4812546e1d94ab17542a2a13.tar.gz tcl-8ca74da02ac96b8f4812546e1d94ab17542a2a13.tar.bz2 |
* generic/tclThread.c: Back-port locking changes from Tcl8.5
in Tcl_Mutex/ConditionFinlize. Now we properly master-lock
the finalization of sync primitives.
FossilOrigin-Name: 4b995f756b80bcd34990c314269b991176cf9e8d
Diffstat (limited to 'generic/tclThread.c')
-rw-r--r-- | generic/tclThread.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclThread.c b/generic/tclThread.c index 033d197..23e82a0 100644 --- a/generic/tclThread.c +++ b/generic/tclThread.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclThread.c,v 1.6.2.2 2007/06/30 09:58:43 vasiljevic Exp $ + * RCS: @(#) $Id: tclThread.c,v 1.6.2.3 2007/11/26 14:05:10 vasiljevic Exp $ */ #include "tclInt.h" @@ -187,6 +187,8 @@ TclThreadDataKeySet(keyPtr, data) * Keep a list of (mutexes/condition variable/data key) * used during finalization. * + * Assume master lock is held. + * * Results: * None. * @@ -245,6 +247,7 @@ RememberSyncObject(objPtr, recPtr) * ForgetSyncObject * * Remove a single object from the list. + * Assume master lock is held. * * Results: * None. @@ -276,6 +279,7 @@ ForgetSyncObject(objPtr, recPtr) * TclRememberMutex * * Keep a list of mutexes used during finalization. + * Assume master lock is held. * * Results: * None. @@ -317,7 +321,9 @@ Tcl_MutexFinalize(mutexPtr) #ifdef TCL_THREADS TclpFinalizeMutex(mutexPtr); #endif + TclpMasterLock(); ForgetSyncObject((char *)mutexPtr, &mutexRecord); + TclpMasterUnlock(); } /* @@ -326,6 +332,7 @@ Tcl_MutexFinalize(mutexPtr) * TclRememberDataKey * * Keep a list of thread data keys used during finalization. + * Assume master lock is held. * * Results: * None. @@ -349,6 +356,7 @@ TclRememberDataKey(keyPtr) * TclRememberCondition * * Keep a list of condition variables used during finalization. + * Assume master lock is held. * * Results: * None. @@ -390,7 +398,9 @@ Tcl_ConditionFinalize(condPtr) #ifdef TCL_THREADS TclpFinalizeCondition(condPtr); #endif + TclpMasterLock(); ForgetSyncObject((char *)condPtr, &condRecord); + TclpMasterUnlock(); } /* |