summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2008-10-13 22:51:31 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2008-10-13 22:51:31 (GMT)
commitfd2a69c6c5b6780f4a47a26379b1c3a5f16b99f6 (patch)
tree7626fb7b16a0adffdfdfda07d60c140378f13156 /win
parent14f6b32610b27825a293f10d6f449649f5109237 (diff)
downloadtcl-fd2a69c6c5b6780f4a47a26379b1c3a5f16b99f6.zip
tcl-fd2a69c6c5b6780f4a47a26379b1c3a5f16b99f6.tar.gz
tcl-fd2a69c6c5b6780f4a47a26379b1c3a5f16b99f6.tar.bz2
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.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinThrd.c6
1 files changed, 5 insertions, 1 deletions
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);