comparison src/share/vm/code/codeCache.cpp @ 2463:3f49d30f8184

7034957: acquiring lock CodeCache_lock/1 out of order with lock tty_lock/0 -- possible deadlock Reviewed-by: iveresov
author never
date Thu, 07 Apr 2011 21:32:23 -0700
parents 527977d4f740
children dbccacb79c63
comparison
equal deleted inserted replaced
2462:4124a5a27707 2463:3f49d30f8184
969 // This is called both with and without CodeCache_lock held so 969 // This is called both with and without CodeCache_lock held so
970 // handle both cases. 970 // handle both cases.
971 if (CodeCache_lock->owned_by_self()) { 971 if (CodeCache_lock->owned_by_self()) {
972 return _heap->largest_free_block(); 972 return _heap->largest_free_block();
973 } else { 973 } else {
974 // Avoid lock ordering problems with ttyLock.
975 ttyUnlocker ttyul;
974 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); 976 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
975 return _heap->largest_free_block(); 977 return _heap->largest_free_block();
976 } 978 }
977 } 979 }