summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2007-11-26 14:05:08 (GMT)
committervasiljevic <zv@archiware.com>2007-11-26 14:05:08 (GMT)
commit1c7799332924b711817436fc8940be2eff501b5c (patch)
tree79cda80ca5c4f12245fd489b3901e5007d44e786
parentcdb09f0ded89acc8b7a6b269f50fc8cd15da9739 (diff)
downloadtcl-1c7799332924b711817436fc8940be2eff501b5c.zip
tcl-1c7799332924b711817436fc8940be2eff501b5c.tar.gz
tcl-1c7799332924b711817436fc8940be2eff501b5c.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.
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclThread.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fbe8165..37dc948 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-26 Zoran Vasiljevic <vasiljevic@users.sourceforge.net>
+
+ * generic/tclThread.c: Back-port locking changes from Tcl8.5
+ in Tcl_Mutex/ConditionFinlize. Now we properly master-lock
+ the finalization of sync primitives.
+
2007-11-15 Don Porter <dgp@users.sourceforge.net>
* generic/regc_nfa.c: Fixed infinite loop in the regexp compiler
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();
}
/*