diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclNotify.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclNotify.c b/generic/tclNotify.c index abd4e04..c09d851 100644 --- a/generic/tclNotify.c +++ b/generic/tclNotify.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNotify.c,v 1.11.2.1 2004/07/15 21:20:25 vasiljevic Exp $ + * RCS: @(#) $Id: tclNotify.c,v 1.11.2.2 2005/04/26 00:46:02 das Exp $ */ #include "tclInt.h" @@ -68,6 +68,7 @@ typedef struct ThreadSpecificData { Tcl_ThreadId threadId; /* Thread that owns this notifier instance. */ ClientData clientData; /* Opaque handle for platform specific * notifier. */ + int initialized; /* 1 if notifier has been initialized. */ struct ThreadSpecificData *nextPtr; /* Next notifier in global list of notifiers. * Access is controlled by the listLock global @@ -118,6 +119,7 @@ TclInitNotifier() tsdPtr->threadId = Tcl_GetCurrentThread(); tsdPtr->clientData = tclStubs.tcl_InitNotifier(); + tsdPtr->initialized = 1; tsdPtr->nextPtr = firstNotifierPtr; firstNotifierPtr = tsdPtr; @@ -157,7 +159,7 @@ TclFinalizeNotifier() ThreadSpecificData **prevPtrPtr; Tcl_Event *evPtr, *hold; - if (tsdPtr->threadId == (Tcl_ThreadId)0) { + if (!tsdPtr->initialized) { return; /* Notifier not initialized for the current thread */ } @@ -184,6 +186,7 @@ TclFinalizeNotifier() break; } } + tsdPtr->initialized = 0; Tcl_MutexUnlock(&listLock); } @@ -876,7 +879,7 @@ Tcl_DoOneEvent(flags) */ if (Tcl_ServiceEvent(flags)) { - result = 1; + result = 1; break; } |