src/hotspot/share/oops/instanceKlass.cpp
changeset 58409 a595e67d6683
parent 58226 408c445d04e8
child 58447 319173c62caa
--- a/src/hotspot/share/oops/instanceKlass.cpp	Mon Sep 30 18:02:24 2019 +0200
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Mon Sep 30 13:10:11 2019 -0400
@@ -1101,7 +1101,7 @@
 
 
 void InstanceKlass::set_implementor(Klass* k) {
-  assert_lock_strong(Compile_lock);
+  assert_locked_or_safepoint(Compile_lock);
   assert(is_interface(), "not interface");
   Klass* volatile* addr = adr_implementor();
   assert(addr != NULL, "null addr");
@@ -2333,8 +2333,8 @@
   // being added to class hierarchy (see SystemDictionary:::add_to_hierarchy()).
   _init_state = allocated;
 
-  {
-    MutexLocker ml(Compile_lock);
+  { // Otherwise this needs to take out the Compile_lock.
+    assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
     init_implementor();
   }