summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclAsync.c31
-rw-r--r--generic/tclEvent.c3
-rw-r--r--generic/tclInt.h3
3 files changed, 32 insertions, 5 deletions
diff --git a/generic/tclAsync.c b/generic/tclAsync.c
index 8d6757f..76e3e28 100644
--- a/generic/tclAsync.c
+++ b/generic/tclAsync.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclAsync.c,v 1.5 2000/07/26 01:28:35 davidg Exp $
+ * RCS: @(#) $Id: tclAsync.c,v 1.6 2001/08/30 07:50:18 davygrvy Exp $
*/
#include "tclInt.h"
@@ -72,9 +72,7 @@ typedef struct ThreadSpecificData {
int asyncActive;
-#ifdef TCL_THREADS
Tcl_Mutex asyncMutex; /* Thread-specific AsyncHandler linked-list lock */
-#endif
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -83,6 +81,33 @@ static Tcl_ThreadDataKey dataKey;
/*
*----------------------------------------------------------------------
*
+ * TclFinalizeAsync --
+ *
+ * Finalizes the mutex in the thread local data structure for the
+ * async subsystem.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Forgets knowledge of the mutex should it have been created.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TclFinalizeAsync()
+{
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (tsdPtr->asyncMutex != NULL) {
+ Tcl_MutexFinalize(&tsdPtr->asyncMutex);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tcl_AsyncCreate --
*
* This procedure creates the data structures for an asynchronous
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 4aae424..4d2337e 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEvent.c,v 1.11 2001/03/31 07:57:31 hobbs Exp $
+ * RCS: @(#) $Id: tclEvent.c,v 1.12 2001/08/30 07:50:18 davygrvy Exp $
*/
#include "tclInt.h"
@@ -907,6 +907,7 @@ Tcl_FinalizeThread()
}
TclFinalizeIOSubsystem();
TclFinalizeNotifier();
+ TclFinalizeAsync();
/*
* Blow away all thread local storage blocks.
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 984f795..daa8a7d 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInt.h,v 1.59 2001/08/23 17:37:08 vincentdarley Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.60 2001/08/30 07:50:18 davygrvy Exp $
*/
#ifndef _TCLINT
@@ -1668,6 +1668,7 @@ EXTERN void TclFinalizeIOSubsystem _ANSI_ARGS_((void));
EXTERN void TclFinalizeLoad _ANSI_ARGS_((void));
EXTERN void TclFinalizeMemorySubsystem _ANSI_ARGS_((void));
EXTERN void TclFinalizeNotifier _ANSI_ARGS_((void));
+EXTERN void TclFinalizeAsync _ANSI_ARGS_((void));
EXTERN void TclFinalizeSynchronization _ANSI_ARGS_((void));
EXTERN void TclFinalizeThreadData _ANSI_ARGS_((void));
EXTERN void TclFindEncodings _ANSI_ARGS_((CONST char *argv0));