8198760: Move global lock SpaceManager::_expand_lock to MutexLocker.cpp

We should avoid having global locks buried in cpp files

Reviewed-by: tschatzl, lfoltan, gtriantafill, stuefe
This commit is contained in:
Coleen Phillimore 2018-03-26 09:35:20 -04:00
parent c450333748
commit c892f948e0
3 changed files with 52 additions and 61 deletions

View file

@ -138,6 +138,8 @@ Mutex* JfrStream_lock = NULL;
Mutex* UnsafeJlong_lock = NULL;
#endif
Mutex* MetaspaceExpand_lock = NULL;
#define MAX_NUM_MUTEX 128
static Monitor * _mutex_array[MAX_NUM_MUTEX];
static int _num_mutex;
@ -210,6 +212,8 @@ void mutex_init() {
def(RawMonitor_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
def(OopMapCacheAlloc_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for oop_map_cache allocation.
def(MetaspaceExpand_lock , PaddedMutex , leaf-1, true, Monitor::_safepoint_check_never);
def(Patching_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never); // used for safepointing and code patching.
def(Service_lock , PaddedMonitor, special, true, Monitor::_safepoint_check_never); // used for service thread operations
def(JmethodIdCreation_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for creating jmethodIDs.