summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
authornijtmans@users.sourceforge.net <jan.nijtmans>2015-09-05 20:10:27 (GMT)
committernijtmans@users.sourceforge.net <jan.nijtmans>2015-09-05 20:10:27 (GMT)
commit5d050a80aa58606e888fb8f64c36a560fbd4930c (patch)
treec7b75091fb572dbe01b788c617eab442584e3669 /unix/tclUnixNotfy.c
parent940f0f70bd2f9a40a839e66d7dd0a11dd223e432 (diff)
parent4dddcf4e025f906c549109bd9b4620c7c5b6bce6 (diff)
downloadtcl-5d050a80aa58606e888fb8f64c36a560fbd4930c.zip
tcl-5d050a80aa58606e888fb8f64c36a560fbd4930c.tar.gz
tcl-5d050a80aa58606e888fb8f64c36a560fbd4930c.tar.bz2
Merge trunk.
"paranoia" patch for the notifier, making sure that thread local data from invalid threads are never accessed by the forked main thread.
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r--unix/tclUnixNotfy.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 2d5a560..f942329 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -1462,6 +1462,12 @@ AtForkChild(void)
pthread_cond_init(&tsdPtr->waitCV, NULL);
#endif
/*
+ * In case, we had multiple threads running before the fork,
+ * make sure, we don't try to reach out to their thread local data.
+ */
+ tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
+
+ /*
* The list of registered event handlers at fork time is in
* tsdPtr->firstFileHandlerPtr;
*/