summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIORChan.c7
-rw-r--r--generic/tclTest.c8
2 files changed, 7 insertions, 8 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index 9ba42ef..846618c 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -2516,6 +2516,7 @@ DeleteReflectedChannelMap(
Tcl_ConditionNotify(&resultPtr->done);
}
+ Tcl_MutexUnlock(&rcForwardMutex);
/*
* Get the map of all channels handled by the current thread. This is a
@@ -2541,8 +2542,6 @@ DeleteReflectedChannelMap(
Tcl_DeleteHashEntry(hPtr);
}
-
- Tcl_MutexUnlock(&rcForwardMutex);
#endif
}
@@ -2650,6 +2649,7 @@ DeleteThreadReflectedChannelMap(
Tcl_ConditionNotify(&resultPtr->done);
}
+ Tcl_MutexUnlock(&rcForwardMutex);
/*
* Get the map of all channels handled by the current thread. This is a
@@ -2667,8 +2667,7 @@ DeleteThreadReflectedChannelMap(
rcPtr->interp = NULL;
Tcl_DeleteHashEntry(hPtr);
}
-
- Tcl_MutexUnlock(&rcForwardMutex);
+ ckfree(rcmPtr);
}
static void
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 3e3bc09..96dcb36 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -799,7 +799,7 @@ TestasyncCmd(
asyncPtr->id = nextId;
nextId++;
asyncPtr->handler = Tcl_AsyncCreate(AsyncHandlerProc,
- (ClientData) asyncPtr->id);
+ INT2PTR(asyncPtr->id));
asyncPtr->nextPtr = firstHandler;
firstHandler = asyncPtr;
Tcl_MutexUnlock(&asyncTestMutex);
@@ -870,7 +870,7 @@ TestasyncCmd(
if (asyncPtr->id == id) {
Tcl_ThreadId threadID;
if (Tcl_CreateThread(&threadID, AsyncThreadProc,
- (ClientData) id, TCL_THREAD_STACK_DEFAULT,
+ INT2PTR(id), TCL_THREAD_STACK_DEFAULT,
TCL_THREAD_NOFLAGS) != TCL_OK) {
Tcl_SetResult(interp, "can't create thread", TCL_STATIC);
return TCL_ERROR;
@@ -901,7 +901,7 @@ AsyncHandlerProc(
int code) /* Current return code from command. */
{
TestAsyncHandler *asyncPtr;
- int id = (int) clientData;
+ int id = PTR2INT(clientData);
const char *listArgv[4], *cmd;
char string[TCL_INTEGER_SPACE];
@@ -958,7 +958,7 @@ AsyncThreadProc(
* TestAsyncHandler, defined above. */
{
TestAsyncHandler *asyncPtr;
- int id = (int) clientData;
+ int id = PTR2INT(clientData);
Tcl_Sleep(1);
Tcl_MutexLock(&asyncTestMutex);