< prev index next >

test/hotspot/gtest/gc/shared/test_ptrQueueBufferAllocator.cpp

Print this page

        

*** 24,34 **** #include "precompiled.hpp" #include "gc/shared/ptrQueue.hpp" #include "memory/allocation.hpp" #include "runtime/interfaceSupport.inline.hpp" ! #include "runtime/orderAccess.hpp" #include "runtime/semaphore.inline.hpp" #include "runtime/thread.hpp" #include "utilities/globalCounter.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp" --- 24,34 ---- #include "precompiled.hpp" #include "gc/shared/ptrQueue.hpp" #include "memory/allocation.hpp" #include "runtime/interfaceSupport.inline.hpp" ! #include "runtime/atomic.hpp" #include "runtime/semaphore.inline.hpp" #include "runtime/thread.hpp" #include "utilities/globalCounter.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp"
*** 148,158 **** _continue_running(continue_running), _allocations(0) {} virtual void main_run() { ! while (OrderAccess::load_acquire(_continue_running)) { BufferNode* node = _allocator->allocate(); _cbl->push(node); ++_allocations; ThreadBlockInVM tbiv(this); // Safepoint check. } --- 148,158 ---- _continue_running(continue_running), _allocations(0) {} virtual void main_run() { ! while (Atomic::load_acquire(_continue_running)) { BufferNode* node = _allocator->allocate(); _cbl->push(node); ++_allocations; ThreadBlockInVM tbiv(this); // Safepoint check. }
*** 182,192 **** virtual void main_run() { while (true) { BufferNode* node = _cbl->pop(); if (node != NULL) { _allocator->release(node); ! } else if (!OrderAccess::load_acquire(_continue_running)) { return; } ThreadBlockInVM tbiv(this); // Safepoint check. } } --- 182,192 ---- virtual void main_run() { while (true) { BufferNode* node = _cbl->pop(); if (node != NULL) { _allocator->release(node); ! } else if (!Atomic::load_acquire(_continue_running)) { return; } ThreadBlockInVM tbiv(this); // Safepoint check. } }
*** 224,239 **** tty->print_cr("Stressing allocator for %u ms", milliseconds_to_run); { ThreadInVMfromNative invm(this_thread); this_thread->sleep(milliseconds_to_run); } ! OrderAccess::release_store(&allocator_running, false); for (uint i = 0; i < nthreads; ++i) { ThreadInVMfromNative invm(this_thread); post.wait_with_safepoint_check(this_thread); } ! OrderAccess::release_store(&processor_running, false); for (uint i = 0; i < nthreads; ++i) { ThreadInVMfromNative invm(this_thread); post.wait_with_safepoint_check(this_thread); } ASSERT_TRUE(BufferNode::TestSupport::try_transfer_pending(allocator)); --- 224,239 ---- tty->print_cr("Stressing allocator for %u ms", milliseconds_to_run); { ThreadInVMfromNative invm(this_thread); this_thread->sleep(milliseconds_to_run); } ! Atomic::release_store(&allocator_running, false); for (uint i = 0; i < nthreads; ++i) { ThreadInVMfromNative invm(this_thread); post.wait_with_safepoint_check(this_thread); } ! Atomic::release_store(&processor_running, false); for (uint i = 0; i < nthreads; ++i) { ThreadInVMfromNative invm(this_thread); post.wait_with_safepoint_check(this_thread); } ASSERT_TRUE(BufferNode::TestSupport::try_transfer_pending(allocator));
< prev index next >