< prev index next >

src/share/vm/oops/instanceKlass.cpp

Print this page

        

*** 1210,1220 **** // Lazily create the _oop_map_cache at first request // Lock-free access requires load_ptr_acquire. OopMapCache* oop_map_cache = static_cast<OopMapCache*>(OrderAccess::load_ptr_acquire(&_oop_map_cache)); if (oop_map_cache == NULL) { ! MutexLocker x(OopMapCacheAlloc_lock); // Check if _oop_map_cache was allocated while we were waiting for this lock if ((oop_map_cache = _oop_map_cache) == NULL) { oop_map_cache = new OopMapCache(); // Ensure _oop_map_cache is stable, since it is examined without a lock OrderAccess::release_store_ptr(&_oop_map_cache, oop_map_cache); --- 1210,1220 ---- // Lazily create the _oop_map_cache at first request // Lock-free access requires load_ptr_acquire. OopMapCache* oop_map_cache = static_cast<OopMapCache*>(OrderAccess::load_ptr_acquire(&_oop_map_cache)); if (oop_map_cache == NULL) { ! MutexLockerEx x(OopMapCacheAlloc_lock, Mutex::_no_safepoint_check_flag); // Check if _oop_map_cache was allocated while we were waiting for this lock if ((oop_map_cache = _oop_map_cache) == NULL) { oop_map_cache = new OopMapCache(); // Ensure _oop_map_cache is stable, since it is examined without a lock OrderAccess::release_store_ptr(&_oop_map_cache, oop_map_cache);
< prev index next >