8223570: Shenandoah needs to acquire lock before CLDG::clear_claimed_marks
authorshade
Wed, 08 May 2019 14:27:14 +0200
changeset 54758 5e5535d25467
parent 54757 6c1a7c2ee530
child 54759 7dbe51e680d1
8223570: Shenandoah needs to acquire lock before CLDG::clear_claimed_marks Reviewed-by: rkennke, tschatzl
src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp	Wed May 08 07:56:49 2019 -0400
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp	Wed May 08 14:27:14 2019 +0200
@@ -554,7 +554,10 @@
 }
 
 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()) {