summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
authorzv@archiware.com <vasiljevic>2004-08-10 19:35:35 (GMT)
committerzv@archiware.com <vasiljevic>2004-08-10 19:35:35 (GMT)
commit1bc45bf1f63c19a93241ca8d97bffd03734284e9 (patch)
tree0f393be1f725a90d8c0f8ec371ad36f3ea629b38 /unix/tclUnixThrd.c
parent2fad8f8b6691d17638b5811e01d5b7ca22709217 (diff)
downloadtcl-1bc45bf1f63c19a93241ca8d97bffd03734284e9.zip
tcl-1bc45bf1f63c19a93241ca8d97bffd03734284e9.tar.gz
tcl-1bc45bf1f63c19a93241ca8d97bffd03734284e9.tar.bz2
Changed handling of the returned thread ID since broken on 64-bit
systems (Cray). Thanks to Rob Ratcliff for reporting the bug.
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 edfc44a..738808a 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -91,6 +91,7 @@ TclpThreadCreate(idPtr, proc, clientData, stackSize, flags)
{
#ifdef TCL_THREADS
pthread_attr_t attr;
+ pthread_t theThread;
int result;
pthread_attr_init(&attr);
@@ -126,12 +127,13 @@ TclpThreadCreate(idPtr, proc, clientData, stackSize, flags)
}
- if (pthread_create((pthread_t *)idPtr, &attr,
+ if (pthread_create(&theThread, &attr,
(void * (*)())proc, (void *)clientData) &&
- pthread_create((pthread_t *)idPtr, NULL,
+ pthread_create(&theThread, NULL,
(void * (*)())proc, (void *)clientData)) {
result = TCL_ERROR;
} else {
+ *idPtr = (Tcl_ThreadId)theThread;
result = TCL_OK;
}
pthread_attr_destroy(&attr);