Diff
Not logged in

Differences From Artifact [eb454bae52]:

To Artifact [8f80dfe8b4]:


336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
	 * and check for EOF in the notifier thread because if a background
	 * child process was created with exec, select() would not register
	 * the EOF on the pipe until the child processes had terminated. [Bug:
	 * 4139] [Bug: 1222872]
	 */

	if (write(triggerPipe, "q", 1) != 1) {
		    Tcl_Panic("Tcl_FinalizeNotifier: unable to write q to triggerPipe");
	}
	close(triggerPipe);
	while(triggerPipe >= 0) {
	    Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
	}

	result = Tcl_JoinThread(notifierThread, NULL);







|







336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
	 * and check for EOF in the notifier thread because if a background
	 * child process was created with exec, select() would not register
	 * the EOF on the pipe until the child processes had terminated. [Bug:
	 * 4139] [Bug: 1222872]
	 */

	if (write(triggerPipe, "q", 1) != 1) {
	    Tcl_Panic("Tcl_FinalizeNotifier: unable to write q to triggerPipe");
	}
	close(triggerPipe);
	while(triggerPipe >= 0) {
	    Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
	}

	result = Tcl_JoinThread(notifierThread, NULL);
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
	if (waitingListPtr) {
	    waitingListPtr->prevPtr = tsdPtr;
	}
	tsdPtr->prevPtr = 0;
	waitingListPtr = tsdPtr;
	tsdPtr->onList = 1;

	if (write(triggerPipe, "", 1) != 1) {
		Tcl_Panic("Tcl_WaitForEvent: unable to write to triggerPipe");
	}
    }

    FD_ZERO(&(tsdPtr->readyMasks.readable));
    FD_ZERO(&(tsdPtr->readyMasks.writable));
    FD_ZERO(&(tsdPtr->readyMasks.exceptional));








|
|







875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
	if (waitingListPtr) {
	    waitingListPtr->prevPtr = tsdPtr;
	}
	tsdPtr->prevPtr = 0;
	waitingListPtr = tsdPtr;
	tsdPtr->onList = 1;

	if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) {
	    Tcl_Panic("Tcl_WaitForEvent: unable to write to triggerPipe");
	}
    }

    FD_ZERO(&(tsdPtr->readyMasks.readable));
    FD_ZERO(&(tsdPtr->readyMasks.writable));
    FD_ZERO(&(tsdPtr->readyMasks.exceptional));

938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
	    waitingListPtr = tsdPtr->nextPtr;
	}
	if (tsdPtr->nextPtr) {
	    tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr;
	}
	tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
	tsdPtr->onList = 0;
	if (write(triggerPipe, "", 1) != 1) {
		Tcl_Panic("Tcl_WaitForEvent: unable to write to triggerPipe");
	}
    }

#else
    tsdPtr->readyMasks = tsdPtr->checkMasks;
    numFound = select(tsdPtr->numFdBits, &(tsdPtr->readyMasks.readable),
	    &(tsdPtr->readyMasks.writable), &(tsdPtr->readyMasks.exceptional),







|
|







938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
	    waitingListPtr = tsdPtr->nextPtr;
	}
	if (tsdPtr->nextPtr) {
	    tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr;
	}
	tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
	tsdPtr->onList = 0;
	if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) {
	    Tcl_Panic("Tcl_WaitForEvent: unable to write to triggerPipe");
	}
    }

#else
    tsdPtr->readyMasks = tsdPtr->checkMasks;
    numFound = select(tsdPtr->numFdBits, &(tsdPtr->readyMasks.readable),
	    &(tsdPtr->readyMasks.writable), &(tsdPtr->readyMasks.exceptional),