16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#endif
/*
* The following variable is used to tell whether this module has been
* initialized.
*/
static int initialized = 0;
/*
* The pipeMutex locks around access to the initialized and procList
* variables, and it is used to protect background threads from being
* terminated while they are using APIs that hold locks.
*/
|
|
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#endif
/*
* The following variable is used to tell whether this module has been
* initialized.
*/
static bool initialized = false;
/*
* The pipeMutex locks around access to the initialized and procList
* variables, and it is used to protect background threads from being
* terminated while they are using APIs that hold locks.
*/
|
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
* Check the initialized flag first, then check again in the mutex. This
* is a speed enhancement.
*/
if (!initialized) {
Tcl_MutexLock(&pipeMutex);
if (!initialized) {
initialized = 1;
procList = NULL;
}
Tcl_MutexUnlock(&pipeMutex);
}
tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
|
|
|
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
* Check the initialized flag first, then check again in the mutex. This
* is a speed enhancement.
*/
if (!initialized) {
Tcl_MutexLock(&pipeMutex);
if (!initialized) {
initialized = true;
procList = NULL;
}
Tcl_MutexUnlock(&pipeMutex);
}
tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
|