src/share/vm/runtime/mutexLocker.cpp

Print this page
rev 4500 : 8014411: Decrease lock order rank for event tracing locks
Reviewed-by: sla, dholmes


 263   def(JfieldIdCreation_lock        , Mutex  , nonleaf+1,   true ); // jfieldID, Used in VM_Operation
 264   def(JNICachedItableIndex_lock    , Mutex  , nonleaf+1,   false); // Used to cache an itable index during JNI invoke
 265 
 266   def(CompiledIC_lock              , Mutex  , nonleaf+2,   false); // locks VtableStubs_lock, InlineCacheBuffer_lock
 267   def(CompileTaskAlloc_lock        , Mutex  , nonleaf+2,   true );
 268   def(CompileStatistics_lock       , Mutex  , nonleaf+2,   false);
 269   def(MultiArray_lock              , Mutex  , nonleaf+2,   false); // locks SymbolTable_lock
 270 
 271   def(JvmtiThreadState_lock        , Mutex  , nonleaf+2,   false); // Used by JvmtiThreadState/JvmtiEventController
 272   def(JvmtiPendingEvent_lock       , Monitor, nonleaf,     false); // Used by JvmtiCodeBlobEvents
 273   def(Management_lock              , Mutex  , nonleaf+2,   false); // used for JVM management
 274 
 275   def(Compile_lock                 , Mutex  , nonleaf+3,   true );
 276   def(MethodData_lock              , Mutex  , nonleaf+3,   false);
 277 
 278   def(MethodCompileQueue_lock      , Monitor, nonleaf+4,   true );
 279   def(Debug2_lock                  , Mutex  , nonleaf+4,   true );
 280   def(Debug3_lock                  , Mutex  , nonleaf+4,   true );
 281   def(CompileThread_lock           , Monitor, nonleaf+5,   false );
 282 
 283   def(JfrMsg_lock                  , Monitor, nonleaf+2,   true);
 284   def(JfrBuffer_lock               , Mutex,   nonleaf+4,   true);
 285   def(JfrStream_lock               , Mutex,   nonleaf+5,   true);
 286   def(PeriodicTask_lock            , Monitor, nonleaf+5,   true);
 287 }
 288 
 289 GCMutexLocker::GCMutexLocker(Monitor * mutex) {
 290   if (SafepointSynchronize::is_at_safepoint()) {
 291     _locked = false;
 292   } else {
 293     _mutex = mutex;
 294     _locked = true;
 295     _mutex->lock();
 296   }
 297 }
 298 
 299 // Print all mutexes/monitors that are currently owned by a thread; called
 300 // by fatal error handler.
 301 void print_owned_locks_on_error(outputStream* st) {
 302   st->print("VM Mutex/Monitor currently owned by a thread: ");
 303   bool none = true;
 304   for (int i = 0; i < _num_mutex; i++) {
 305      // see if it has an owner


 263   def(JfieldIdCreation_lock        , Mutex  , nonleaf+1,   true ); // jfieldID, Used in VM_Operation
 264   def(JNICachedItableIndex_lock    , Mutex  , nonleaf+1,   false); // Used to cache an itable index during JNI invoke
 265 
 266   def(CompiledIC_lock              , Mutex  , nonleaf+2,   false); // locks VtableStubs_lock, InlineCacheBuffer_lock
 267   def(CompileTaskAlloc_lock        , Mutex  , nonleaf+2,   true );
 268   def(CompileStatistics_lock       , Mutex  , nonleaf+2,   false);
 269   def(MultiArray_lock              , Mutex  , nonleaf+2,   false); // locks SymbolTable_lock
 270 
 271   def(JvmtiThreadState_lock        , Mutex  , nonleaf+2,   false); // Used by JvmtiThreadState/JvmtiEventController
 272   def(JvmtiPendingEvent_lock       , Monitor, nonleaf,     false); // Used by JvmtiCodeBlobEvents
 273   def(Management_lock              , Mutex  , nonleaf+2,   false); // used for JVM management
 274 
 275   def(Compile_lock                 , Mutex  , nonleaf+3,   true );
 276   def(MethodData_lock              , Mutex  , nonleaf+3,   false);
 277 
 278   def(MethodCompileQueue_lock      , Monitor, nonleaf+4,   true );
 279   def(Debug2_lock                  , Mutex  , nonleaf+4,   true );
 280   def(Debug3_lock                  , Mutex  , nonleaf+4,   true );
 281   def(CompileThread_lock           , Monitor, nonleaf+5,   false );
 282 
 283   def(JfrMsg_lock                  , Monitor, leaf,        true);
 284   def(JfrBuffer_lock               , Mutex,   nonleaf+1,   true);
 285   def(JfrStream_lock               , Mutex,   nonleaf+2,   true);
 286   def(PeriodicTask_lock            , Monitor, nonleaf+5,   true);
 287 }
 288 
 289 GCMutexLocker::GCMutexLocker(Monitor * mutex) {
 290   if (SafepointSynchronize::is_at_safepoint()) {
 291     _locked = false;
 292   } else {
 293     _mutex = mutex;
 294     _locked = true;
 295     _mutex->lock();
 296   }
 297 }
 298 
 299 // Print all mutexes/monitors that are currently owned by a thread; called
 300 // by fatal error handler.
 301 void print_owned_locks_on_error(outputStream* st) {
 302   st->print("VM Mutex/Monitor currently owned by a thread: ");
 303   bool none = true;
 304   for (int i = 0; i < _num_mutex; i++) {
 305      // see if it has an owner