< prev index next >

src/hotspot/share/code/icBuffer.cpp

Concurrent class unloading
 
 // Enqueue this icholder for release during the next safepoint.  It's
 // not safe to free them until them since they might be visible to
 // another thread.
 void InlineCacheBuffer::queue_for_release(CompiledICHolder* icholder) {
-  MutexLockerEx mex(InlineCacheBuffer_lock);
+  MutexLockerEx mex(InlineCacheBuffer_lock, Mutex::_no_safepoint_check_flag);
+  if (icholder->is_enqueued()) {
+    return;
+  }
   icholder->set_next(_pending_released);
+  icholder->set_enqueued();
   _pending_released = icholder;
   _pending_count++;
   if (TraceICBuffer) {
     tty->print_cr("enqueueing icholder " INTPTR_FORMAT " to be freed", p2i(icholder));
   }
    
< prev index next >