diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2015-05-28 00:53:33 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2015-05-28 00:53:33 (GMT) |
commit | 24fdf2893b2456dba53e49f20fc54769fa6cbc0c (patch) | |
tree | 71ca1aaad8738c90d56250145b42c5c2f1ee906c | |
parent | 7fa687177b07fd7f6b98ae321402848466ce6d17 (diff) | |
parent | ed5453934369f6fb2b7b45f8ef1e9854e7268679 (diff) | |
download | tcl-24fdf2893b2456dba53e49f20fc54769fa6cbc0c.zip tcl-24fdf2893b2456dba53e49f20fc54769fa6cbc0c.tar.gz tcl-24fdf2893b2456dba53e49f20fc54769fa6cbc0c.tar.bz2 |
Make sure the necessary mutexes are in a well-known state across calls to fork().
-rw-r--r-- | unix/tclUnixNotfy.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index aa32915..219dd75 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -1334,6 +1334,9 @@ NotifierThreadProc( static void AtForkPrepare(void) { + Tcl_MutexLock(¬ifierMutex); + TclpMasterLock(); + TclpMutexLock(); } /* @@ -1355,6 +1358,9 @@ AtForkPrepare(void) static void AtForkParent(void) { + TclpMutexUnlock(); + TclpMasterUnlock(); + Tcl_MutexUnlock(¬ifierMutex); } /* @@ -1376,6 +1382,8 @@ AtForkParent(void) static void AtForkChild(void) { + TclpMutexUnlock(); + TclpMasterUnlock(); Tcl_MutexUnlockAndFinalize(¬ifierMutex); Tcl_InitNotifier(); } |