[Mono-dev] [PATCH] Changes for CreateThread calls.

Bill Holmes billholmes54 at gmail.com
Wed Mar 25 12:22:23 EDT 2009


Hi,

The attached patch fixes some problems I was seeing with thread IDs on Winx64.

What I found was that the thread ID argument of CreateThread is a
ulong which is not 64 bits on Winx64.  So when called with the address
of a size variable the top 32 bits are garbage.  This patch simply
initializes all thread ID variables to zero before calling
CreateThread.  Is there a better way to fix this?

-bill



2009-03-25  Bill Holmes  <billholmes54 at gmail.com>

	* appdomain.c (mono_domain_unload),
	* attach.c (transport_start_receive),
	* threads.c (mono_thread_create_internal),
	* threads.c (ves_icall_System_Threading_Thread_Thread_internal):
	  Initialize the tid variable to 0 before calls to CreateThread.
	  This is needed for Winx64 because that argument is only 32 bits.

	Code is contributed under MIT/X11 license.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CreateThread.patch
Type: application/octet-stream
Size: 2012 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090325/c754fb0f/attachment.obj 


More information about the Mono-devel-list mailing list