summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2004-04-23 07:20:09 (GMT)
committerdavygrvy <davygrvy@pobox.com>2004-04-23 07:20:09 (GMT)
commitb9fbb790fc3e89f64c1034b6ee5af4210c11d12a (patch)
tree88e958c61aa8200f45ed61a91030511bb71521d5 /unix/tclUnixThrd.c
parentf613f9eed33b82c3d712a4679fa56e3192d9e283 (diff)
downloadtcl-b9fbb790fc3e89f64c1034b6ee5af4210c11d12a.zip
tcl-b9fbb790fc3e89f64c1034b6ee5af4210c11d12a.tar.gz
tcl-b9fbb790fc3e89f64c1034b6ee5af4210c11d12a.tar.bz2
* generic/tclInt.h:
* generic/tclThread.c: * generic/tclEvent.c: * unix/tclUnixThrd.c: * win/tclWinThrd.c: Provisions made so masterLock, initLock, allocLock and joinLock mutexes can be recovered during Tcl_Finalize.
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r--unix/tclUnixThrd.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index f67248c..c087423 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -254,7 +254,37 @@ TclpInitLock()
pthread_mutex_lock(&initLock);
#endif
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclpFinalizeLock
+ *
+ * This procedure is used to destroy all private resources used in
+ * this file.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Destroys everything private. TclpInitLock must be held
+ * entering this function.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+TclFinalizeLock ()
+{
+#ifdef TCL_THREADS
+ /*
+ * You do not need to destroy mutexes that were created with the
+ * PTHREAD_MUTEX_INITIALIZER macro. These mutexes do not need
+ * any destruction: masterLock, allocLock, and initLock.
+ */
+ pthread_mutex_unlock(&initLock);
+#endif
+}
/*
*----------------------------------------------------------------------