comparison src/share/vm/code/codeCache.cpp @ 2482:dbccacb79c63

7036236: VM crashes assert((!inside_attrs()) || is_error_reported()) failed ... Summary: Eliminate the race condition. Reviewed-by: kvn
author iveresov
date Thu, 14 Apr 2011 00:02:21 -0700
parents 3f49d30f8184
children 167b70ff3abc
comparison
equal deleted inserted replaced
2481:3a808be061ff 2482:dbccacb79c63
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;
976 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); 974 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
977 return _heap->largest_free_block(); 975 return _heap->largest_free_block();
978 } 976 }
979 } 977 }