We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a65e5e commit b85082aCopy full SHA for b85082a
generic/threadCmd.c
@@ -583,8 +583,17 @@ Init(
583
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
584
585
if (tsdPtr->interp == NULL) {
586
+ Tcl_Interp *tmpInterp, *mainInterp = interp;
587
memset(tsdPtr, 0, sizeof(ThreadSpecificData));
- tsdPtr->interp = interp;
588
+ /*
589
+ * Retrieve main interpreter of the thread, only
590
+ * main interpreter used as default thread-interpreter,
591
+ * so no childs here, see bug [d4ba38d00d06ebba]
592
+ */
593
+ while (mainInterp && (tmpInterp = Tcl_GetMaster(mainInterp))) {
594
+ mainInterp = tmpInterp;
595
+ }
596
+ tsdPtr->interp = mainInterp;
597
ListUpdate(tsdPtr);
598
Tcl_CreateThreadExitHandler(ThreadExitProc,
599
threadEmptyResult);
0 commit comments