Skip to content

Commit 6db1c4f

Browse files
committed
8371409: Wrong lock ordering between FullGCALot_lock and ThreadsLockThrottle_lock/MethodCompileQueue_lock
Reviewed-by: rehn, pchilanomate
1 parent c8b30da commit 6db1c4f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hotspot/share/memory/universe.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ void Universe::genesis(TRAPS) {
544544
// Only modify the global variable inside the mutex.
545545
// If we had a race to here, the other dummy_array instances
546546
// and their elements just get dropped on the floor, which is fine.
547-
MutexLocker ml(THREAD, FullGCALot_lock);
547+
MutexLocker ml(THREAD, FullGCALot_lock, Mutex::_no_safepoint_check_flag);
548548
if (_fullgc_alot_dummy_array.is_empty()) {
549549
_fullgc_alot_dummy_array = OopHandle(vm_global(), dummy_array());
550550
}
@@ -1458,7 +1458,7 @@ uintptr_t Universe::verify_mark_bits() {
14581458
#ifdef ASSERT
14591459
// Release dummy object(s) at bottom of heap
14601460
bool Universe::release_fullgc_alot_dummy() {
1461-
MutexLocker ml(FullGCALot_lock);
1461+
MutexLocker ml(FullGCALot_lock, Mutex::_no_safepoint_check_flag);
14621462
objArrayOop fullgc_alot_dummy_array = (objArrayOop)_fullgc_alot_dummy_array.resolve();
14631463
if (fullgc_alot_dummy_array != nullptr) {
14641464
if (_fullgc_alot_dummy_next >= fullgc_alot_dummy_array->length()) {

src/hotspot/share/runtime/mutexLocker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void mutex_init() {
244244
MUTEX_DEFN(SymbolArena_lock , PaddedMutex , nosafepoint);
245245
MUTEX_DEFN(ExceptionCache_lock , PaddedMutex , safepoint);
246246
#ifndef PRODUCT
247-
MUTEX_DEFN(FullGCALot_lock , PaddedMutex , safepoint); // a lock to make FullGCALot MT safe
247+
MUTEX_DEFN(FullGCALot_lock , PaddedMutex , nosafepoint); // a lock to make FullGCALot MT safe
248248
#endif
249249
MUTEX_DEFN(BeforeExit_lock , PaddedMonitor, safepoint);
250250

0 commit comments

Comments
 (0)