Index: generic/tclNotify.c =================================================================== RCS file: /cvsroot/tcl/tcl/generic/tclNotify.c,v retrieving revision 1.16 diff -u -p -r1.16 tclNotify.c --- generic/tclNotify.c 30 Nov 2004 19:34:49 -0000 1.16 +++ generic/tclNotify.c 17 Apr 2005 04:38:01 -0000 @@ -67,6 +67,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 @@ -124,6 +125,7 @@ TclInitNotifier() tsdPtr = TCL_TSD_INIT(&dataKey); tsdPtr->threadId = threadId; tsdPtr->clientData = tclStubs.tcl_InitNotifier(); + tsdPtr->initialized = 1; tsdPtr->nextPtr = firstNotifierPtr; firstNotifierPtr = tsdPtr; } @@ -163,7 +165,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 */ } @@ -190,6 +192,7 @@ TclFinalizeNotifier() break; } } + tsdPtr->initialized = 0; Tcl_MutexUnlock(&listLock); } Index: unix/tclUnixNotfy.c =================================================================== RCS file: /cvsroot/tcl/tcl/unix/tclUnixNotfy.c,v retrieving revision 1.20 diff -u -p -r1.20 tclUnixNotfy.c --- unix/tclUnixNotfy.c 21 Jan 2005 22:25:35 -0000 1.20 +++ unix/tclUnixNotfy.c 17 Apr 2005 04:38:01 -0000 @@ -685,7 +685,9 @@ Tcl_WaitForEvent(timePtr) myTime.sec = timePtr->sec; myTime.usec = timePtr->usec; - (*tclScaleTimeProcPtr) (&myTime, tclTimeClientData); + if (myTime.sec != 0 || myTime.usec != 0) { + (*tclScaleTimeProcPtr) (&myTime, tclTimeClientData); + } #ifdef TCL_THREADS myTimePtr = &myTime;