307
308
309
310
311
312
313
314
315
316
317
318
319
320
|
#endif /* HAVE_PTHREAD_ATFORK */
/*
* Check if my process id changed, e.g. I was forked
* In this case, restart the notifier thread and close the
* pipe to the original notifier thread
*/
if (notifierCount > 0 && processIDInitialized != getpid()) {
notifierCount = 0;
processIDInitialized = 0;
close(triggerPipe);
triggerPipe = -1;
}
if (notifierCount == 0) {
if (TclpThreadCreate(¬ifierThread, NotifierThreadProc, NULL,
|
>
|
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
#endif /* HAVE_PTHREAD_ATFORK */
/*
* Check if my process id changed, e.g. I was forked
* In this case, restart the notifier thread and close the
* pipe to the original notifier thread
*/
if (notifierCount > 0 && processIDInitialized != getpid()) {
Tcl_ConditionFinalize(¬ifierCV);
notifierCount = 0;
processIDInitialized = 0;
close(triggerPipe);
triggerPipe = -1;
}
if (notifierCount == 0) {
if (TclpThreadCreate(¬ifierThread, NotifierThreadProc, NULL,
|
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
|
*
*----------------------------------------------------------------------
*/
static void
AtForkChild(void)
{
notifierMutex = NULL;
notifierCV = NULL;
Tcl_InitNotifier();
}
#endif /* HAVE_PTHREAD_ATFORK */
#endif /* TCL_THREADS */
#endif /* !HAVE_COREFOUNDATION */
|
|
<
|
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
|
*
*----------------------------------------------------------------------
*/
static void
AtForkChild(void)
{
Tcl_MutexFinalize(¬ifierMutex);
Tcl_InitNotifier();
}
#endif /* HAVE_PTHREAD_ATFORK */
#endif /* TCL_THREADS */
#endif /* !HAVE_COREFOUNDATION */
|