From 8b645aed8f5bf864e5e9244d9784a7536a932c02 Mon Sep 17 00:00:00 2001 From: vasiljevic Date: Tue, 10 Aug 2004 19:35:35 +0000 Subject: Changed handling of the returned thread ID since broken on 64-bit systems (Cray). Thanks to Rob Ratcliff for reporting the bug. --- ChangeLog | 6 ++++++ unix/tclUnixThrd.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd9a33d..f50e44d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-08-10 Zoran Vasiljevic + + * unix/tclUnixThrd.c (TclpThreadCreate): changed handling of + the returned thread ID since broken on 64-bit systems (Cray). + Thanks to Rob Ratcliff for reporting the bug. + 2004-07-30 Don Porter * generic/tclEvent.c (Tcl_Finalize): Re-organized Tcl_Finalize 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); -- cgit v0.12