Tcl Source Code

Artifact [3037feeb5c]
Login

Artifact 3037feeb5ca35a9d9a085b3e27a3e5cb733c3339:

Attachment "unix-notify.patch" to ticket [749639ffff] added by dizzi 2003-06-05 23:31:15.
--- /tmp/tclUnixNotfy.c	Sun May 11 00:42:24 2003
+++ unix/tclUnixNotfy.c	Thu Jun  5 17:47:34 2003
@@ -166,6 +166,11 @@
  */
 static Tcl_ThreadId notifierThread;
 
+/*
+ * The parent pid of the notifier thread.
+ */
+static pid_t notifierThreadParent = 0;
+
 #endif
 
 /*
@@ -213,6 +218,7 @@
 	    panic("Tcl_InitNotifier: unable to start notifier thread");
 	}
     }
+    notifierThreadParent = getpid();
     notifierCount++;
 
     /*
@@ -252,6 +258,13 @@
 {
 #ifdef TCL_THREADS
     ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+    /*
+     * If this process is not the parent of notifierThread do nothing.
+     */
+    if (notifierThreadParent != getpid()) {
+	return;
+    }
 
     Tcl_MutexLock(&notifierMutex);
     notifierCount--;