summaryrefslogtreecommitdiffstats
path: root/generic/tclThread.c
diff options
context:
space:
mode:
authorvasiljevic <vasiljevic@noemail.net>2007-10-25 18:40:27 (GMT)
committervasiljevic <vasiljevic@noemail.net>2007-10-25 18:40:27 (GMT)
commit82e0cc2356420bf72ff988369e39569008b9018e (patch)
tree6c772bde47f60a5fc61cb2a13879efc8693c6124 /generic/tclThread.c
parenta9f43b7ac5e7f430cf77a301246742696fd01fbe (diff)
downloadtcl-82e0cc2356420bf72ff988369e39569008b9018e.zip
tcl-82e0cc2356420bf72ff988369e39569008b9018e.tar.gz
tcl-82e0cc2356420bf72ff988369e39569008b9018e.tar.bz2
Added TclpMasterLock/Unlock arround calls to ForgetSyncObject in
Tcl_MutexFinalize and Tcl_ConditionFinalize to prevent from garbling the internal list that track synchronization objects. FossilOrigin-Name: 4daa3e5a3dbc9cffc2c8274aff78863ba1afbf87
Diffstat (limited to 'generic/tclThread.c')
-rw-r--r--generic/tclThread.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tclThread.c b/generic/tclThread.c
index 9732a4f..bf623ba 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.17 2007/06/30 09:59:00 vasiljevic Exp $
+ * RCS: @(#) $Id: tclThread.c,v 1.18 2007/10/25 18:40:28 vasiljevic Exp $
*/
#include "tclInt.h"
@@ -142,6 +142,8 @@ TclThreadDataKeyGet(
* Keep a list of (mutexes/condition variable/data key) used during
* finalization.
*
+ * Assume master lock is held.
+ *
* Results:
* None.
*
@@ -201,6 +203,7 @@ RememberSyncObject(
* ForgetSyncObject
*
* Remove a single object from the list.
+ * Assume master lock is held.
*
* Results:
* None.
@@ -232,6 +235,7 @@ ForgetSyncObject(
* TclRememberMutex
*
* Keep a list of mutexes used during finalization.
+ * Assume master lock is held.
*
* Results:
* None.
@@ -273,7 +277,9 @@ Tcl_MutexFinalize(
#ifdef TCL_THREADS
TclpFinalizeMutex(mutexPtr);
#endif
+ TclpMasterLock();
ForgetSyncObject((char *) mutexPtr, &mutexRecord);
+ TclpMasterUnlock();
}
/*
@@ -282,6 +288,7 @@ Tcl_MutexFinalize(
* TclRememberCondition
*
* Keep a list of condition variables used during finalization.
+ * Assume master lock is held.
*
* Results:
* None.
@@ -323,7 +330,9 @@ Tcl_ConditionFinalize(
#ifdef TCL_THREADS
TclpFinalizeCondition(condPtr);
#endif
+ TclpMasterLock();
ForgetSyncObject((char *) condPtr, &condRecord);
+ TclpMasterUnlock();
}
/*