src/hotspot/share/classfile/systemDictionary.cpp
changeset 51608 625a5bdde0c5
parent 51543 5303c6c05db6
child 51610 cdef4df6b0e7
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Fri Aug 31 12:41:00 2018 +0200
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Fri Aug 31 07:03:46 2018 -0400
@@ -1919,6 +1919,7 @@
 
 void SystemDictionary::methods_do(void f(Method*)) {
   // Walk methods in loaded classes
+  MutexLocker ml(ClassLoaderDataGraph_lock);
   ClassLoaderDataGraph::methods_do(f);
   // Walk method handle intrinsics
   invoke_method_table()->methods_do(f);
@@ -1936,6 +1937,7 @@
 void SystemDictionary::remove_classes_in_error_state() {
   ClassLoaderData::the_null_class_loader_data()->dictionary()->remove_classes_in_error_state();
   RemoveClassesClosure rcc;
+  MutexLocker ml(ClassLoaderDataGraph_lock);
   ClassLoaderDataGraph::cld_do(&rcc);
 }