From dd4bd718f68c159cfd56b0a21fb425a8fdf4941a Mon Sep 17 00:00:00 2001 From: hobbs Date: Tue, 29 May 2007 23:35:05 +0000 Subject: * unix/tclUnixThrd.c (Tcl_JoinThread): fix for 64-bit handling of pthread_join exit return code storage. [Bug 1712723] --- ChangeLog | 5 +++++ unix/tclUnixThrd.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67b8949..8539bd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-29 Jeff Hobbs + + * unix/tclUnixThrd.c (Tcl_JoinThread): fix for 64-bit handling of + pthread_join exit return code storage. [Bug 1712723] + 2007-05-18 Don Porter * unix/configure: autoconf-2.59 (FC6 fork) diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 2760360..5f4f15c 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixThrd.c,v 1.51 2006/12/19 16:25:02 dgp Exp $ + * RCS: @(#) $Id: tclUnixThrd.c,v 1.52 2007/05/29 23:35:06 hobbs Exp $ */ #include "tclInt.h" @@ -158,12 +158,16 @@ Tcl_JoinThread( Tcl_ThreadId threadId, /* Id of the thread to wait upon. */ int *state) /* Reference to the storage the result of the * thread we wait upon will be written - * into. */ + * into. May be NULL. */ { #ifdef TCL_THREADS int result; + unsigned long retcode; - result = pthread_join((pthread_t) threadId, (void**) state); + result = pthread_join((pthread_t) threadId, (void**) &retcode); + if (state) { + *state = (int) retcode; + } return (result == 0) ? TCL_OK : TCL_ERROR; #else return TCL_ERROR; -- cgit v0.12