hotspot/src/share/vm/oops/cpCache.cpp
changeset 25354 f6762819b488
parent 25351 7c198a690050
parent 25325 e3af4e02b0d5
child 28019 a6303ff71902
equal deleted inserted replaced
25353:806fe0d44237 25354:f6762819b488
   285   // Competing writers must acquire exclusive access via a lock.
   285   // Competing writers must acquire exclusive access via a lock.
   286   // A losing writer waits on the lock until the winner writes f1 and leaves
   286   // A losing writer waits on the lock until the winner writes f1 and leaves
   287   // the lock, so that when the losing writer returns, he can use the linked
   287   // the lock, so that when the losing writer returns, he can use the linked
   288   // cache entry.
   288   // cache entry.
   289 
   289 
   290   MonitorLockerEx ml(cpool->lock());
   290   // Use the lock from the metaspace for this, which cannot stop for safepoint.
       
   291   Mutex* metaspace_lock = cpool->pool_holder()->class_loader_data()->metaspace_lock();
       
   292   MutexLockerEx ml(metaspace_lock,  Mutex::_no_safepoint_check_flag);
   291   if (!is_f1_null()) {
   293   if (!is_f1_null()) {
   292     return;
   294     return;
   293   }
   295   }
   294 
   296 
   295   const methodHandle adapter = call_info.resolved_method();
   297   const methodHandle adapter = call_info.resolved_method();