# HG changeset patch # User never # Date 1302237143 25200 # Node ID 6b04b8a49ea8f281e87602a55db249aa19ae6b60 # Parent a4c6e44296935da3166ea334e98ab2fdae4b6370 7034957: acquiring lock CodeCache_lock/1 out of order with lock tty_lock/0 -- possible deadlock Reviewed-by: iveresov diff -r a4c6e4429693 -r 6b04b8a49ea8 hotspot/src/share/vm/code/codeCache.cpp --- a/hotspot/src/share/vm/code/codeCache.cpp Thu Apr 07 17:12:23 2011 -0700 +++ b/hotspot/src/share/vm/code/codeCache.cpp Thu Apr 07 21:32:23 2011 -0700 @@ -971,6 +971,8 @@ 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(); }