mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
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
1 changed files with 2 additions and 0 deletions
|
@ -971,6 +971,8 @@ size_t CodeCache::largest_free_block() {
|
|||
if (CodeCache_lock->owned_by_self()) {
|
||||
return _heap->largest_free_block();
|
||||
} else {
|
||||
// Avoid lock ordering problems with ttyLock.
|
||||
ttyUnlocker ttyul;
|
||||
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
return _heap->largest_free_block();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue