< prev index next >

src/hotspot/share/runtime/mutexLocker.cpp

Print this page




 121 Monitor* RootRegionScan_lock          = NULL;
 122 
 123 Monitor* GCTaskManager_lock           = NULL;
 124 
 125 Mutex*   Management_lock              = NULL;
 126 Monitor* Service_lock                 = NULL;
 127 Monitor* PeriodicTask_lock            = NULL;
 128 Monitor* RedefineClasses_lock         = NULL;
 129 
 130 #if INCLUDE_TRACE
 131 Mutex*   JfrStacktrace_lock           = NULL;
 132 Monitor* JfrMsg_lock                  = NULL;
 133 Mutex*   JfrBuffer_lock               = NULL;
 134 Mutex*   JfrStream_lock               = NULL;
 135 #endif
 136 
 137 #ifndef SUPPORTS_NATIVE_CX8
 138 Mutex*   UnsafeJlong_lock             = NULL;
 139 #endif
 140 


 141 #define MAX_NUM_MUTEX 128
 142 static Monitor * _mutex_array[MAX_NUM_MUTEX];
 143 static int _num_mutex;
 144 
 145 #ifdef ASSERT
 146 void assert_locked_or_safepoint(const Monitor * lock) {
 147   // check if this thread owns the lock (common case)
 148   if (IgnoreLockingAssertions) return;
 149   assert(lock != NULL, "Need non-NULL lock");
 150   if (lock->owned_by_self()) return;
 151   if (SafepointSynchronize::is_at_safepoint()) return;
 152   if (!Universe::is_fully_initialized()) return;
 153   // see if invoker of VM operation owns it
 154   VM_Operation* op = VMThread::vm_operation();
 155   if (op != NULL && op->calling_thread() == lock->owner()) return;
 156   fatal("must own lock %s", lock->name());
 157 }
 158 
 159 // a stronger assertion than the above
 160 void assert_lock_strong(const Monitor * lock) {


 192 
 193     def(FreeList_lock              , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
 194     def(SecondaryFreeList_lock     , PaddedMonitor, leaf     ,   true,  Monitor::_safepoint_check_never);
 195     def(OldSets_lock               , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
 196     def(RootRegionScan_lock        , PaddedMonitor, leaf     ,   true,  Monitor::_safepoint_check_never);
 197 
 198     def(StringDedupQueue_lock      , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);
 199     def(StringDedupTable_lock      , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 200 
 201     def(MarkStackFreeList_lock     , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
 202     def(MarkStackChunkList_lock    , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
 203   }
 204   def(ParGCRareEvent_lock          , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_sometimes);
 205   def(DerivedPointerTableGC_lock   , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 206 #ifdef INCLUDE_ALL_GCS
 207   def(CGCPhaseManager_lock         , PaddedMonitor, leaf,        false, Monitor::_safepoint_check_sometimes);
 208 #endif
 209   def(CodeCache_lock               , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
 210   def(RawMonitor_lock              , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
 211   def(OopMapCacheAlloc_lock        , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);     // used for oop_map_cache allocation.


 212 
 213   def(Patching_lock                , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);      // used for safepointing and code patching.
 214   def(Service_lock                 , PaddedMonitor, special,     true,  Monitor::_safepoint_check_never);      // used for service thread operations
 215   def(JmethodIdCreation_lock       , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);     // used for creating jmethodIDs.
 216 
 217   def(SystemDictionary_lock        , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_always);     // lookups done by VM thread
 218   def(Module_lock                  , PaddedMutex  , leaf+2,      true,  Monitor::_safepoint_check_always);
 219   def(InlineCacheBuffer_lock       , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);
 220   def(VMStatistic_lock             , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);
 221   def(ExpandHeap_lock              , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);     // Used during compilation by VM thread
 222   def(JNIHandleBlockFreeList_lock  , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);      // handles are used by VM thread
 223   def(SignatureHandlerLibrary_lock , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);
 224   def(SymbolTable_lock             , PaddedMutex  , leaf+2,      true,  Monitor::_safepoint_check_always);
 225   def(StringTable_lock             , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);
 226   def(ProfilePrint_lock            , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);     // serial profile printing
 227   def(ExceptionCache_lock          , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);     // serial profile printing
 228   def(OsrList_lock                 , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 229   def(Debug1_lock                  , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 230 #ifndef PRODUCT
 231   def(FullGCALot_lock              , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);     // a lock to make FullGCALot MT safe




 121 Monitor* RootRegionScan_lock          = NULL;
 122 
 123 Monitor* GCTaskManager_lock           = NULL;
 124 
 125 Mutex*   Management_lock              = NULL;
 126 Monitor* Service_lock                 = NULL;
 127 Monitor* PeriodicTask_lock            = NULL;
 128 Monitor* RedefineClasses_lock         = NULL;
 129 
 130 #if INCLUDE_TRACE
 131 Mutex*   JfrStacktrace_lock           = NULL;
 132 Monitor* JfrMsg_lock                  = NULL;
 133 Mutex*   JfrBuffer_lock               = NULL;
 134 Mutex*   JfrStream_lock               = NULL;
 135 #endif
 136 
 137 #ifndef SUPPORTS_NATIVE_CX8
 138 Mutex*   UnsafeJlong_lock             = NULL;
 139 #endif
 140 
 141 Mutex*   MetaspaceExpand_lock         = NULL;
 142 
 143 #define MAX_NUM_MUTEX 128
 144 static Monitor * _mutex_array[MAX_NUM_MUTEX];
 145 static int _num_mutex;
 146 
 147 #ifdef ASSERT
 148 void assert_locked_or_safepoint(const Monitor * lock) {
 149   // check if this thread owns the lock (common case)
 150   if (IgnoreLockingAssertions) return;
 151   assert(lock != NULL, "Need non-NULL lock");
 152   if (lock->owned_by_self()) return;
 153   if (SafepointSynchronize::is_at_safepoint()) return;
 154   if (!Universe::is_fully_initialized()) return;
 155   // see if invoker of VM operation owns it
 156   VM_Operation* op = VMThread::vm_operation();
 157   if (op != NULL && op->calling_thread() == lock->owner()) return;
 158   fatal("must own lock %s", lock->name());
 159 }
 160 
 161 // a stronger assertion than the above
 162 void assert_lock_strong(const Monitor * lock) {


 194 
 195     def(FreeList_lock              , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
 196     def(SecondaryFreeList_lock     , PaddedMonitor, leaf     ,   true,  Monitor::_safepoint_check_never);
 197     def(OldSets_lock               , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
 198     def(RootRegionScan_lock        , PaddedMonitor, leaf     ,   true,  Monitor::_safepoint_check_never);
 199 
 200     def(StringDedupQueue_lock      , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);
 201     def(StringDedupTable_lock      , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 202 
 203     def(MarkStackFreeList_lock     , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
 204     def(MarkStackChunkList_lock    , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
 205   }
 206   def(ParGCRareEvent_lock          , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_sometimes);
 207   def(DerivedPointerTableGC_lock   , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 208 #ifdef INCLUDE_ALL_GCS
 209   def(CGCPhaseManager_lock         , PaddedMonitor, leaf,        false, Monitor::_safepoint_check_sometimes);
 210 #endif
 211   def(CodeCache_lock               , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
 212   def(RawMonitor_lock              , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
 213   def(OopMapCacheAlloc_lock        , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);     // used for oop_map_cache allocation.
 214 
 215   def(MetaspaceExpand_lock         , PaddedMutex  , leaf-1,      true,  Monitor::_safepoint_check_never);
 216 
 217   def(Patching_lock                , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);      // used for safepointing and code patching.
 218   def(Service_lock                 , PaddedMonitor, special,     true,  Monitor::_safepoint_check_never);      // used for service thread operations
 219   def(JmethodIdCreation_lock       , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);     // used for creating jmethodIDs.
 220 
 221   def(SystemDictionary_lock        , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_always);     // lookups done by VM thread
 222   def(Module_lock                  , PaddedMutex  , leaf+2,      true,  Monitor::_safepoint_check_always);
 223   def(InlineCacheBuffer_lock       , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);
 224   def(VMStatistic_lock             , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);
 225   def(ExpandHeap_lock              , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);     // Used during compilation by VM thread
 226   def(JNIHandleBlockFreeList_lock  , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);      // handles are used by VM thread
 227   def(SignatureHandlerLibrary_lock , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);
 228   def(SymbolTable_lock             , PaddedMutex  , leaf+2,      true,  Monitor::_safepoint_check_always);
 229   def(StringTable_lock             , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);
 230   def(ProfilePrint_lock            , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);     // serial profile printing
 231   def(ExceptionCache_lock          , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);     // serial profile printing
 232   def(OsrList_lock                 , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 233   def(Debug1_lock                  , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 234 #ifndef PRODUCT
 235   def(FullGCALot_lock              , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);     // a lock to make FullGCALot MT safe


< prev index next >