summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2015-07-17 21:22:22 (GMT)
committerdgp@users.sourceforge.net <dgp>2015-07-17 21:22:22 (GMT)
commitdee9a9cbe77ea21d498f9c6c3885df0a93c8da50 (patch)
treeeb303b04e47fe05468dc5620171a0ee2c8453095 /unix/tclUnixNotfy.c
parent3b5dff82b3bea4153a4034c95ebdc7af76076428 (diff)
parent77985b9936c999f8cbcb0f87825fedb45afada9a (diff)
downloadtcl-dee9a9cbe77ea21d498f9c6c3885df0a93c8da50.zip
tcl-dee9a9cbe77ea21d498f9c6c3885df0a93c8da50.tar.gz
tcl-dee9a9cbe77ea21d498f9c6c3885df0a93c8da50.tar.bz2
merge trunk
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r--unix/tclUnixNotfy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index c6c9759..b2bea45 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -194,7 +194,7 @@ static Tcl_ThreadId notifierThread;
#ifdef TCL_THREADS
static void NotifierThreadProc(ClientData clientData);
-#ifdef HAVE_PTHREAD_ATFORK
+#if defined(HAVE_PTHREAD_ATFORK) && !defined(__APPLE__) && !defined(__hpux)
static int atForkInit = 0;
static void AtForkPrepare(void);
static void AtForkParent(void);
@@ -290,7 +290,7 @@ Tcl_InitNotifier(void)
*/
Tcl_MutexLock(&notifierMutex);
-#ifdef HAVE_PTHREAD_ATFORK
+#if defined(HAVE_PTHREAD_ATFORK) && !defined(__APPLE__) && !defined(__hpux)
/*
* Install pthread_atfork handlers to reinitialize the notifier in the
* child of a fork.
@@ -304,13 +304,14 @@ Tcl_InitNotifier(void)
}
atForkInit = 1;
}
-#endif
+#endif /* HAVE_PTHREAD_ATFORK */
/*
* Check if my process id changed, e.g. I was forked
* In this case, restart the notifier thread and close the
* pipe to the original notifier thread
*/
if (notifierCount > 0 && processIDInitialized != getpid()) {
+ Tcl_ConditionFinalize(&notifierCV);
notifierCount = 0;
processIDInitialized = 0;
close(triggerPipe);
@@ -1313,7 +1314,7 @@ NotifierThreadProc(
TclpThreadExit(0);
}
-#ifdef HAVE_PTHREAD_ATFORK
+#if defined(HAVE_PTHREAD_ATFORK) && !defined(__APPLE__) && !defined(__hpux)
/*
*----------------------------------------------------------------------
*
@@ -1375,8 +1376,7 @@ AtForkParent(void)
static void
AtForkChild(void)
{
- notifierMutex = NULL;
- notifierCV = NULL;
+ Tcl_MutexFinalize(&notifierMutex);
Tcl_InitNotifier();
}
#endif /* HAVE_PTHREAD_ATFORK */