[Mono-dev] [PATCH] Don't wait for finalizer thread in mono_gc_init

Kornél Pál kornelpal at gmail.com
Sat May 9 08:09:21 EDT 2009


Hi,

This is a quite small patch removing the wait form mono_gc_init by 
modifying mono_thread_create_internal to return the MonoThread object.

Getting rid of the wait is required for support loading the runtime from 
DLL initialization code on Windows because DLL load and initialization 
is protected by the same lock as thread creation so this lock always 
results in a deadlock.

Removing this wait on other platform should make startup faster.

I was unable to reproduce any deadlock resulting from this wait, I only 
was able to reproduce a socket accept deadlock (Windows-only bug) that 
was discussed on the list earlier and is not related to this wait.

I belive that this patch should eliminate the deadlock that the removed 
wait is intended to prevent. If you still are able to reproduce the 
deadlock, please attach exact stack trace for deadlocked threads and 
I'll try solve the issue.

Please review the patch and if you like it please approve it.

Kornél
-------------- next part --------------
A non-text attachment was scrubbed...
Name: finalizer_thread_nowait.diff
Type: text/x-patch
Size: 3662 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090509/0e3cc2c7/attachment.bin 


More information about the Mono-devel-list mailing list