~MutexUnlockerEx() { if (_no_safepoint_check == Mutex::_no_safepoint_check_flag) { _mutex->lock_without_safepoint_check(); } else { _mutex->lock(); } }
VerifyMutexLocker(Monitor * mutex) { _mutex = mutex; _reentrant = mutex->owned_by_self(); if (!_reentrant) { // We temp. diable strict safepoint checking, while we require the lock FlagSetting fs(StrictSafepointChecks, false); _mutex->lock(); } }
MutexLockerEx(Monitor * mutex, bool no_safepoint_check = !Mutex::_no_safepoint_check_flag) { _mutex = mutex; if (_mutex != NULL) { assert(mutex->rank() > Mutex::special || no_safepoint_check, "Mutexes with rank special or lower should not do safepoint checks"); if (no_safepoint_check) _mutex->lock_without_safepoint_check(); else _mutex->lock(); } }
~MutexUnlocker() { _mutex->lock(); }
// Overloaded constructor passing current thread MutexLocker(Monitor * mutex, Thread *thread) { assert(mutex->rank() != Mutex::special, "Special ranked mutex should only use MutexLockerEx"); _mutex = mutex; _mutex->lock(thread); }