summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2004-08-10 19:40:48 (GMT)
committervasiljevic <zv@archiware.com>2004-08-10 19:40:48 (GMT)
commit610769bdb8172c2f6fa55f1cb6b0b4f7d40bc5ce (patch)
tree5527d75a486b5cf6543b149b9373f6ef678098d0
parent8da4ff8750166fa5b7735aa5e1f90cce3b70ca36 (diff)
downloadtcl-610769bdb8172c2f6fa55f1cb6b0b4f7d40bc5ce.zip
tcl-610769bdb8172c2f6fa55f1cb6b0b4f7d40bc5ce.tar.gz
tcl-610769bdb8172c2f6fa55f1cb6b0b4f7d40bc5ce.tar.bz2
Changed handling of the returned thread ID since broken on 64-bit
systems (Cray). Thanks to Rob Ratcliff for reporting the bug.
-rw-r--r--ChangeLog6
-rw-r--r--unix/tclUnixThrd.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b169536..f012094 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-08-10 Zoran Vasiljevic <vasiljevic@users.sf.net>
+
+ * 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-08-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* generic/tclNamesp.c (MakeCachedEnsembleCommand): Initialize the
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);