diff options
Diffstat (limited to 'rts/sm')
-rw-r--r-- | rts/sm/GC.c | 3 | ||||
-rw-r--r-- | rts/sm/GC.h | 1 | ||||
-rw-r--r-- | rts/sm/NonMoving.c | 6 | ||||
-rw-r--r-- | rts/sm/NonMoving.h | 3 |
4 files changed, 9 insertions, 4 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c index c39dcc2e89..fc9146c2fa 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -196,6 +196,7 @@ void GarbageCollect (uint32_t collect_gen, const bool do_heap_census, const bool deadlock_detect, + const bool force_nonconcurrent, uint32_t gc_type USED_IF_THREADS, Capability *cap, bool idle_cap[]) @@ -779,7 +780,7 @@ GarbageCollect (uint32_t collect_gen, // upd_rem_set nonmovingAddUpdRemSetBlocks(&gct->cap->upd_rem_set.queue); #endif - nonmovingCollect(&dead_weak_ptr_list, &resurrected_threads); + nonmovingCollect(&dead_weak_ptr_list, &resurrected_threads, force_nonconcurrent); ACQUIRE_SM_LOCK; } diff --git a/rts/sm/GC.h b/rts/sm/GC.h index bde006913b..33b98b6e20 100644 --- a/rts/sm/GC.h +++ b/rts/sm/GC.h @@ -20,6 +20,7 @@ void GarbageCollect (uint32_t collect_gen, bool do_heap_census, bool deadlock_detect, + bool force_nonconcurrent, uint32_t gc_type, Capability *cap, bool idle_cap[]); diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c index 388ceae2fd..1118bf2a5c 100644 --- a/rts/sm/NonMoving.c +++ b/rts/sm/NonMoving.c @@ -894,7 +894,9 @@ static void nonmovingMarkWeakPtrList(MarkQueue *mark_queue, StgWeak *dead_weak_p } } -void nonmovingCollect(StgWeak **dead_weaks, StgTSO **resurrected_threads) +void nonmovingCollect(StgWeak **dead_weaks, + StgTSO **resurrected_threads, + bool force_nonmoving) { #if defined(THREADED_RTS) // We can't start a new collection until the old one has finished @@ -973,7 +975,7 @@ void nonmovingCollect(StgWeak **dead_weaks, StgTSO **resurrected_threads) // again for the sync if we let it go, because it'll immediately start doing // a major GC, because that's what we do when exiting scheduler (see // exitScheduler()). - if (sched_state == SCHED_RUNNING) { + if (sched_state == SCHED_RUNNING && !force_nonconcurrent) { concurrent_coll_running = true; nonmoving_write_barrier_enabled = true; debugTrace(DEBUG_nonmoving_gc, "Starting concurrent mark thread"); diff --git a/rts/sm/NonMoving.h b/rts/sm/NonMoving.h index 6eabcb8493..1e19babf6f 100644 --- a/rts/sm/NonMoving.h +++ b/rts/sm/NonMoving.h @@ -126,7 +126,8 @@ void nonmovingExit(void); // directly, but in a pause. // void nonmovingCollect(StgWeak **dead_weaks, - StgTSO **resurrected_threads); + StgTSO **resurrected_threads, + bool force_nonmoving); void *nonmovingAllocate(Capability *cap, StgWord sz); void nonmovingAddCapabilities(uint32_t new_n_caps); |