summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r--unix/tclUnixThrd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index aad394f..b79442f 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -90,6 +90,7 @@ TclpThreadCreate(idPtr, proc, clientData, stackSize, flags)
{
#ifdef TCL_THREADS
pthread_attr_t attr;
+ pthread_t theThread;
int result;
pthread_attr_init(&attr);
@@ -125,12 +126,13 @@ TclpThreadCreate(idPtr, proc, clientData, stackSize, flags)
}
- if (pthread_create((pthread_t *)idPtr, &attr,
+ if (pthread_create(&theThread, &attr,
(void * (*)(void *))proc, (void *)clientData) &&
- pthread_create((pthread_t *)idPtr, NULL,
+ pthread_create(&theThread, NULL,
(void * (*)(void *))proc, (void *)clientData)) {
result = TCL_ERROR;
} else {
+ *idPtr = (Tcl_ThreadId)theThread;
result = TCL_OK;
}
pthread_attr_destroy(&attr);