summaryrefslogtreecommitdiffstats
path: root/tcl8.6/generic/tclThreadTest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcl8.6/generic/tclThreadTest.c')
-rw-r--r--tcl8.6/generic/tclThreadTest.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tcl8.6/generic/tclThreadTest.c b/tcl8.6/generic/tclThreadTest.c
index fcf3880..35b3fc3 100644
--- a/tcl8.6/generic/tclThreadTest.c
+++ b/tcl8.6/generic/tclThreadTest.c
@@ -174,7 +174,6 @@ TclThread_Init(
Tcl_CreateObjCommand(interp, "testthread", ThreadObjCmd, NULL, NULL);
return TCL_OK;
}
-
/*
*----------------------------------------------------------------------
@@ -248,7 +247,7 @@ ThreadObjCmd(
switch ((enum options)option) {
case THREAD_CANCEL: {
- long id;
+ Tcl_WideInt id;
const char *result;
int flags, arg;
@@ -264,7 +263,7 @@ ThreadObjCmd(
arg++;
}
}
- if (Tcl_GetLongFromObj(interp, objv[arg], &id) != TCL_OK) {
+ if (Tcl_GetWideIntFromObj(interp, objv[arg], &id) != TCL_OK) {
return TCL_ERROR;
}
arg++;
@@ -1158,6 +1157,14 @@ ThreadExitProc(
Tcl_MutexLock(&threadMutex);
+ if (self == errorThreadId) {
+ if (errorProcString) { /* Extra safety */
+ ckfree(errorProcString);
+ errorProcString = NULL;
+ }
+ errorThreadId = 0;
+ }
+
if (threadEvalScript) {
ckfree(threadEvalScript);
threadEvalScript = NULL;