< prev index next >

src/hotspot/share/runtime/synchronizer.cpp

Print this page

        

*** 882,892 **** } // Visitors ... void ObjectSynchronizer::monitors_iterate(MonitorClosure* closure) { ! PaddedObjectMonitor* block = OrderAccess::load_acquire(&g_block_list); while (block != NULL) { assert(block->object() == CHAINMARKER, "must be a block header"); for (int i = _BLOCKSIZE - 1; i > 0; i--) { ObjectMonitor* mid = (ObjectMonitor *)(block + i); oop object = (oop)mid->object(); --- 882,892 ---- } // Visitors ... void ObjectSynchronizer::monitors_iterate(MonitorClosure* closure) { ! PaddedObjectMonitor* block = Atomic::load_acquire(&g_block_list); while (block != NULL) { assert(block->object() == CHAINMARKER, "must be a block header"); for (int i = _BLOCKSIZE - 1; i > 0; i--) { ObjectMonitor* mid = (ObjectMonitor *)(block + i); oop object = (oop)mid->object();
*** 1111,1121 **** // The very first ObjectMonitor in a block is reserved and dedicated. // It serves as blocklist "next" linkage. temp[0]._next_om = g_block_list; // There are lock-free uses of g_block_list so make sure that // the previous stores happen before we update g_block_list. ! OrderAccess::release_store(&g_block_list, temp); // Add the new string of ObjectMonitors to the global free list temp[_BLOCKSIZE - 1]._next_om = g_free_list; g_free_list = temp + 1; Thread::muxRelease(&gListLock); --- 1111,1121 ---- // The very first ObjectMonitor in a block is reserved and dedicated. // It serves as blocklist "next" linkage. temp[0]._next_om = g_block_list; // There are lock-free uses of g_block_list so make sure that // the previous stores happen before we update g_block_list. ! Atomic::release_store(&g_block_list, temp); // Add the new string of ObjectMonitors to the global free list temp[_BLOCKSIZE - 1]._next_om = g_free_list; g_free_list = temp + 1; Thread::muxRelease(&gListLock);
*** 2162,2172 **** // Check if monitor belongs to the monitor cache // The list is grow-only so it's *relatively* safe to traverse // the list of extant blocks without taking a lock. int ObjectSynchronizer::verify_objmon_isinpool(ObjectMonitor *monitor) { ! PaddedObjectMonitor* block = OrderAccess::load_acquire(&g_block_list); while (block != NULL) { assert(block->object() == CHAINMARKER, "must be a block header"); if (monitor > &block[0] && monitor < &block[_BLOCKSIZE]) { address mon = (address)monitor; address blk = (address)block; --- 2162,2172 ---- // Check if monitor belongs to the monitor cache // The list is grow-only so it's *relatively* safe to traverse // the list of extant blocks without taking a lock. int ObjectSynchronizer::verify_objmon_isinpool(ObjectMonitor *monitor) { ! PaddedObjectMonitor* block = Atomic::load_acquire(&g_block_list); while (block != NULL) { assert(block->object() == CHAINMARKER, "must be a block header"); if (monitor > &block[0] && monitor < &block[_BLOCKSIZE]) { address mon = (address)monitor; address blk = (address)block;
< prev index next >