summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2007-10-25 18:40:28 (GMT)
committervasiljevic <zv@archiware.com>2007-10-25 18:40:28 (GMT)
commitde08bfbfcc14f2395e5d299ad28a3bd26c93f7b2 (patch)
tree6c772bde47f60a5fc61cb2a13879efc8693c6124
parent7b06bea8377025d0d73731d4332f1140468cf591 (diff)
downloadtcl-de08bfbfcc14f2395e5d299ad28a3bd26c93f7b2.zip
tcl-de08bfbfcc14f2395e5d299ad28a3bd26c93f7b2.tar.gz
tcl-de08bfbfcc14f2395e5d299ad28a3bd26c93f7b2.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.
-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();
}
/*