From: Rodrigo Kumpera Date: Thu, 12 May 2011 19:01:48 +0000 (-0700) Subject: Merge pull request #82 from Unity-Technologies/master-gc-race X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=a779b309ab59e88b4f29666fab166916ad815622 Merge pull request #82 from Unity-Technologies/master-gc-race [Fix] Fix intermittent initialization race crash with boehm gc. --- a779b309ab59e88b4f29666fab166916ad815622 diff --cc mono/metadata/boehm-gc.c index 1112bb283cf,495827be66b..2055a64e0b7 --- a/mono/metadata/boehm-gc.c +++ b/mono/metadata/boehm-gc.c @@@ -390,13 -375,9 +390,14 @@@ on_gc_notification (GCEventType event { MonoGCEvent e = (MonoGCEvent)event; + if (e == MONO_GC_EVENT_PRE_STOP_WORLD) + mono_thread_info_suspend_lock (); + else if (e == MONO_GC_EVENT_POST_START_WORLD) + mono_thread_info_suspend_unlock (); + if (e == MONO_GC_EVENT_START) { - mono_perfcounters->gc_collections0++; + if (mono_perfcounters) + mono_perfcounters->gc_collections0++; mono_stats.major_gc_count ++; gc_start_time = mono_100ns_ticks (); } else if (e == MONO_GC_EVENT_END) {