269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
-
+
+
|
} else {
result = NULL;
}
return ThreadCancel(interp, (Tcl_ThreadId) INT2PTR(id), result, flags);
}
case THREAD_CREATE: {
const char *script;
int joinable, len;
int joinable;
Tcl_Size len;
if (objc == 2) {
/*
* Neither joinable nor special script
*/
joinable = 0;
|
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
|
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
|
-
+
|
if (!found) {
Tcl_MutexUnlock(&threadMutex);
Tcl_AppendResult(interp, "invalid thread id", NULL);
return TCL_ERROR;
}
/*
* Short circut sends to ourself. Ought to do something with -async, like
* Short circuit sends to ourself. Ought to do something with -async, like
* run in an idle handler.
*/
if (threadId == Tcl_GetCurrentThread()) {
Tcl_MutexUnlock(&threadMutex);
return Tcl_EvalEx(interp, script,-1,TCL_EVAL_GLOBAL);
}
|