summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2004-05-06 01:02:58 (GMT)
committerdavygrvy <davygrvy@pobox.com>2004-05-06 01:02:58 (GMT)
commit84a75075141136a76e5f65c8e3c322704de6b830 (patch)
tree8be2eee4339ed42785159834b5069e9f59dc7f0f /unix
parent67c13e8ce843ef9594171c0789af6bbce954ab5c (diff)
downloadtcl-84a75075141136a76e5f65c8e3c322704de6b830.zip
tcl-84a75075141136a76e5f65c8e3c322704de6b830.tar.gz
tcl-84a75075141136a76e5f65c8e3c322704de6b830.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')
-rw-r--r--unix/tclUnixThrd.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 427a974..aa26c51 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -255,7 +255,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
+}
/*
*----------------------------------------------------------------------