Attachment "patch.txt" to
ticket [414419ffff]
added by
davygrvy
2001-04-12 07:58:32.
*** generic/tclAsync.c 2000/07/26 01:28:35 1.5
--- generic/tclAsync.c 2001/04/12 00:43:10
***************
*** 72,84 ****
int asyncActive;
- #ifdef TCL_THREADS
Tcl_Mutex asyncMutex; /* Thread-specific AsyncHandler linked-list lock */
- #endif
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
*----------------------------------------------------------------------
--- 72,109 ----
int asyncActive;
Tcl_Mutex asyncMutex; /* Thread-specific AsyncHandler linked-list lock */
} ThreadSpecificData;
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);
+ }
+ }
/*
*----------------------------------------------------------------------
*** generic/tclEvent.c 2001/03/31 07:57:31 1.11
--- generic/tclEvent.c 2001/04/12 00:43:13
***************
*** 907,912 ****
--- 907,913 ----
}
TclFinalizeIOSubsystem();
TclFinalizeNotifier();
+ TclFinalizeAsync();
/*
* Blow away all thread local storage blocks.
*** generic/tclInt.h 2000/08/25 02:04:29 1.50
--- generic/tclInt.h 2001/04/12 00:43:20
***************
*** 1688,1693 ****
--- 1688,1694 ----
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));
*** win/tclWinThrd.c 2000/06/13 20:30:24 1.11
--- win/tclWinThrd.c 2001/04/12 00:43:24
***************
*** 479,484 ****
--- 479,485 ----
{
CRITICAL_SECTION *csPtr = *(CRITICAL_SECTION **)mutexPtr;
if (csPtr != NULL) {
+ DeleteCriticalSection(csPtr);
ckfree((char *)csPtr);
*mutexPtr = NULL;
}