summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
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)
commit05956b6b36e17a834210d8c5640f9b359efda7a1 (patch)
treec7b75091fb572dbe01b788c617eab442584e3669 /unix/tclUnixNotfy.c
parent85699b47e75cbc847ca7d7ce9a93ac36342d4ebe (diff)
parent1ee459aa148ae0eb14af0f2c7f190c994a03504e (diff)
downloadtcl-05956b6b36e17a834210d8c5640f9b359efda7a1.zip
tcl-05956b6b36e17a834210d8c5640f9b359efda7a1.tar.gz
tcl-05956b6b36e17a834210d8c5640f9b359efda7a1.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;
*/