7034957: acquiring lock CodeCache_lock/1 out of order with lock tty_lock/0 -- possible deadlock
Reviewed-by: iveresov
This commit is contained in:
parent
f8fe3457a5
commit
fe74e1ba6a
@ -971,6 +971,8 @@ size_t CodeCache::largest_free_block() {
|
|||||||
if (CodeCache_lock->owned_by_self()) {
|
if (CodeCache_lock->owned_by_self()) {
|
||||||
return _heap->largest_free_block();
|
return _heap->largest_free_block();
|
||||||
} else {
|
} else {
|
||||||
|
// Avoid lock ordering problems with ttyLock.
|
||||||
|
ttyUnlocker ttyul;
|
||||||
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||||
return _heap->largest_free_block();
|
return _heap->largest_free_block();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user