summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
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;
*/