7034957: acquiring lock CodeCache_lock/1 out of order with lock tty_lock/0 -- possible deadlock

Reviewed-by: iveresov
This commit is contained in:
Tom Rodriguez 2011-04-07 21:32:23 -07:00
parent f8fe3457a5
commit fe74e1ba6a

View File

@ -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();
}