< prev index next >

test/hotspot/gtest/utilities/test_globalCounter_nested.cpp

Print this page

        

*** 22,32 **** */ #include "precompiled.hpp" #include "metaprogramming/isRegisteredEnum.hpp" #include "runtime/atomic.hpp" - #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" #include "utilities/globalCounter.hpp" #include "utilities/globalCounter.inline.hpp" #include "utilities/spinYield.hpp" #include "threadHelper.inline.hpp" --- 22,31 ----
*** 55,90 **** {} ~RCUNestedThread() {} void set_state(NestedTestState new_state) { ! OrderAccess::release_store(&_state, new_state); } void wait_with_state(NestedTestState new_state) { SpinYield spinner; ! OrderAccess::release_store(&_state, new_state); ! while (!OrderAccess::load_acquire(&_proceed)) { spinner.wait(); } ! OrderAccess::release_store(&_proceed, false); } public: NestedTestState state() const { ! return OrderAccess::load_acquire(&_state); } void wait_for_state(NestedTestState goal) { SpinYield spinner; while (state() != goal) { spinner.wait(); } } void proceed() { ! OrderAccess::release_store(&_proceed, true); } }; class RCUNestedReaderThread : public RCUNestedThread { public: --- 54,89 ---- {} ~RCUNestedThread() {} void set_state(NestedTestState new_state) { ! Atomic::release_store(&_state, new_state); } void wait_with_state(NestedTestState new_state) { SpinYield spinner; ! Atomic::release_store(&_state, new_state); ! while (!Atomic::load_acquire(&_proceed)) { spinner.wait(); } ! Atomic::release_store(&_proceed, false); } public: NestedTestState state() const { ! return Atomic::load_acquire(&_state); } void wait_for_state(NestedTestState goal) { SpinYield spinner; while (state() != goal) { spinner.wait(); } } void proceed() { ! Atomic::release_store(&_proceed, true); } }; class RCUNestedReaderThread : public RCUNestedThread { public:
< prev index next >