From 2dede35a180160e91d72a5194fc9b8f476f902a4 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 8 May 2019 14:27:14 +0200 Subject: [PATCH] 8223570: Shenandoah needs to acquire lock before CLDG::clear_claimed_marks Reviewed-by: rkennke, tschatzl --- src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp index 5ccdcb2e499..b8b12c8f2fb 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp @@ -554,7 +554,10 @@ bool ShenandoahTraversalGC::check_and_handle_cancelled_gc(ShenandoahTaskTerminat } void ShenandoahTraversalGC::concurrent_traversal_collection() { - ClassLoaderDataGraph::clear_claimed_marks(); + { + MutexLocker ml(ClassLoaderDataGraph_lock); + ClassLoaderDataGraph::clear_claimed_marks(); + } ShenandoahGCPhase phase_work(ShenandoahPhaseTimings::conc_traversal); if (!_heap->cancelled_gc()) {