if (GC_debugging_started) {
(*GC_check_heap)();
}
- if (GC_on_collection_event)
+ if (GC_on_collection_event) {
GC_on_collection_event(GC_EVENT_MARK_END);
-
+# ifdef THREADS
+ GC_on_collection_event(GC_EVENT_PRE_START_WORLD);
+# endif
+ }
# ifdef THREAD_LOCAL_ALLOC
GC_world_stopped = FALSE;
# endif
-# ifdef THREADS
- if (GC_on_collection_event)
- GC_on_collection_event(GC_EVENT_PRE_START_WORLD);
-# endif
-
START_WORLD();
# ifdef THREADS
if (GC_incremental) {
# ifdef CHECKSUMS
GC_read_dirty(FALSE);
+ GC_check_dirty();
# else
GC_read_dirty(GC_mark_state == MS_INVALID);
# endif
}
-# endif
-# ifdef CHECKSUMS
- if (GC_incremental) GC_check_dirty();
-# endif
-# if !defined(GC_DISABLE_INCREMENTAL)
GC_n_rescuing_pages = 0;
# endif
if (GC_mark_state == MS_NONE) {
/* the list of functions which synchronize memory). */
# endif
n_live_threads = GC_restart_all();
-# ifndef GC_OPENBSD_UTHREADS
+# ifdef GC_OPENBSD_UTHREADS
+ (void)n_live_threads;
+# elif defined(GC_NETBSD_THREADS_WORKAROUND)
if (GC_retry_signals)
n_live_threads = resend_lost_signals(n_live_threads, GC_restart_all);
-# ifdef GC_NETBSD_THREADS_WORKAROUND
- suspend_restart_barrier(n_live_threads);
-# else
- if (GC_retry_signals)
- suspend_restart_barrier(n_live_threads);
-# endif
+ suspend_restart_barrier(n_live_threads);
# else
- (void)n_live_threads;
+ if (GC_retry_signals) {
+ n_live_threads = resend_lost_signals(n_live_threads, GC_restart_all);
+ suspend_restart_barrier(n_live_threads);
+ }
# endif
# ifdef DEBUG_THREADS
GC_log_printf("World started\n");