8257817: Shenandoah: Don't race with conc-weak-in-progress flag in weak-LRB

Reviewed-by: rkennke
This commit is contained in:
Zhengyu Gu 2020-12-07 19:19:23 +00:00
parent a265c20138
commit 395b6bdeee

View File

@ -2063,9 +2063,6 @@ void ShenandoahHeap::op_weak_roots() {
ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_weak_roots_work);
ShenandoahConcurrentWeakRootsEvacUpdateTask task(ShenandoahPhaseTimings::conc_weak_roots_work);
workers()->run_task(&task);
if (!ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) {
set_concurrent_weak_root_in_progress(false);
}
}
// Perform handshake to flush out dead oops
@ -2073,6 +2070,10 @@ void ShenandoahHeap::op_weak_roots() {
ShenandoahTimingsTracker t(ShenandoahPhaseTimings::conc_weak_roots_rendezvous);
rendezvous_threads();
}
if (!ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) {
set_concurrent_weak_root_in_progress(false);
}
}
}