From 1b423f2d3a9c5f583ea4cf826489aa9f07c2a1ca Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Wed, 27 May 2015 22:29:25 +0000 Subject: Make sure the master and mutex locks are in a well-known state across the fork() call. --- unix/tclUnixNotfy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 9186f33..2941331 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -1335,6 +1335,8 @@ static void AtForkPrepare(void) { Tcl_MutexLock(¬ifierMutex); + TclpMasterLock(); + TclpMutexLock(); } /* @@ -1356,6 +1358,8 @@ AtForkPrepare(void) static void AtForkParent(void) { + TclpMutexLock(); + TclpMasterLock(); Tcl_MutexUnlock(¬ifierMutex); } @@ -1378,6 +1382,8 @@ AtForkParent(void) static void AtForkChild(void) { + TclpMutexLock(); + TclpMasterLock(); Tcl_MutexUnlockAndFinalize(¬ifierMutex); Tcl_InitNotifier(); } -- cgit v0.12