From fd2a69c6c5b6780f4a47a26379b1c3a5f16b99f6 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Mon, 13 Oct 2008 22:51:31 +0000 Subject: We need to initialize the thread id variable to 0 as on 64 bit windows this is a pointer sized field while windows only fills it with a 32 bit value. The result is an inability to join the threads as the ids cannot be matched. --- ChangeLog | 6 ++++++ win/tclWinThrd.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 858ad7f..3353b04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-10-13 Pat Thoyts + * win/tclWinThrd.c (TclpThreadCreate): We need to initialize the + thread id variable to 0 as on 64 bit windows this is a pointer + sized field while windows only fills it with a 32 bit value. The + result is an inability to join the threads as the ids cannot be + matched. + * generic/tclTest.c (TestNRELevels): set array to the right size 2008-10-13 Donal K. Fellows diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index 9667d7d..62a538b 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinThrd.c,v 1.48 2008/07/24 21:54:43 nijtmans Exp $ + * RCS: @(#) $Id: tclWinThrd.c,v 1.49 2008/10/13 22:51:31 patthoyts Exp $ */ #include "tclWinInt.h" @@ -155,6 +155,10 @@ TclpThreadCreate( EnterCriticalSection(&joinLock); + *idPtr = 0; /* must initialize as Tcl_Thread is a pointer and + * on WIN64 sizeof void* != sizeof unsigned + */ + #if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__BORLANDC__) tHandle = (HANDLE) _beginthreadex(NULL, (unsigned) stackSize, proc, clientData, 0, (unsigned *)idPtr); -- cgit v0.12