summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-09-05 20:10:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-09-05 20:10:27 (GMT)
commitdf364c80db2c62f74714bd0ec26fae4d552c837e (patch)
treec7b75091fb572dbe01b788c617eab442584e3669 /unix
parent69d6754d432cdf6e463254245e8f10085cd1f70d (diff)
parentd4aa4fa0fbce6e8491b76598051ea0e596d16331 (diff)
downloadtcl-df364c80db2c62f74714bd0ec26fae4d552c837e.zip
tcl-df364c80db2c62f74714bd0ec26fae4d552c837e.tar.gz
tcl-df364c80db2c62f74714bd0ec26fae4d552c837e.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')
-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;
*/