< prev index next >

src/hotspot/share/gc/shared/concurrentGCThread.cpp

Print this page

        

*** 49,68 **** run_service(); // Signal thread has terminated MonitorLocker ml(Terminator_lock); ! OrderAccess::release_store(&_has_terminated, true); ml.notify_all(); } void ConcurrentGCThread::stop() { assert(!should_terminate(), "Invalid state"); assert(!has_terminated(), "Invalid state"); // Signal thread to terminate ! OrderAccess::release_store_fence(&_should_terminate, true); stop_service(); // Wait for thread to terminate MonitorLocker ml(Terminator_lock); --- 49,68 ---- run_service(); // Signal thread has terminated MonitorLocker ml(Terminator_lock); ! Atomic::release_store(&_has_terminated, true); ml.notify_all(); } void ConcurrentGCThread::stop() { assert(!should_terminate(), "Invalid state"); assert(!has_terminated(), "Invalid state"); // Signal thread to terminate ! Atomic::release_store_fence(&_should_terminate, true); stop_service(); // Wait for thread to terminate MonitorLocker ml(Terminator_lock);
*** 70,80 **** ml.wait(); } } bool ConcurrentGCThread::should_terminate() const { ! return OrderAccess::load_acquire(&_should_terminate); } bool ConcurrentGCThread::has_terminated() const { ! return OrderAccess::load_acquire(&_has_terminated); } --- 70,80 ---- ml.wait(); } } bool ConcurrentGCThread::should_terminate() const { ! return Atomic::load_acquire(&_should_terminate); } bool ConcurrentGCThread::has_terminated() const { ! return Atomic::load_acquire(&_has_terminated); }
< prev index next >