[profiler] Emit post-gc sync point with the world stopped to avoid racing with alloca...
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 13 Jun 2017 23:41:13 +0000 (16:41 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 14 Jun 2017 21:54:17 +0000 (14:54 -0700)
mono/profiler/log.c

index 51b3249d8c98ed36daca429c93d64cfcd8ad4c70..817ea4d5235dc02665177c77bb1821a18236c964 100644 (file)
@@ -1513,8 +1513,7 @@ gc_event (MonoProfiler *profiler, MonoGCEvent ev, int generation)
                        heapshot_requested = 0;
                        last_hs_time = current_time ();
                }
-               break;
-       case MONO_GC_EVENT_POST_START_WORLD_UNLOCKED:
+
                /*
                 * Similarly, we must now make sure that any object moves
                 * written to the GC thread's buffer are flushed. Otherwise,
@@ -1523,7 +1522,8 @@ gc_event (MonoProfiler *profiler, MonoGCEvent ev, int generation)
                 */
                if (ENABLED (ALL_GC_EVENTS_MASK))
                        sync_point_mark (SYNC_POINT_WORLD_START);
-
+               break;
+       case MONO_GC_EVENT_POST_START_WORLD_UNLOCKED:
                /*
                 * Finally, it is safe to allow other threads to write to
                 * their buffers again.