src/hotspot/share/gc/shared/concurrentGCThread.cpp
changeset 54623 1126f0607c70
parent 54329 ddd60ad787d4
child 59247 56bf71d64d51
equal deleted inserted replaced
54622:a8dcacf95bff 54623:1126f0607c70
    48   wait_init_completed();
    48   wait_init_completed();
    49 
    49 
    50   run_service();
    50   run_service();
    51 
    51 
    52   // Signal thread has terminated
    52   // Signal thread has terminated
    53   MonitorLockerEx ml(Terminator_lock);
    53   MonitorLocker ml(Terminator_lock);
    54   OrderAccess::release_store(&_has_terminated, true);
    54   OrderAccess::release_store(&_has_terminated, true);
    55   ml.notify_all();
    55   ml.notify_all();
    56 }
    56 }
    57 
    57 
    58 void ConcurrentGCThread::stop() {
    58 void ConcurrentGCThread::stop() {
    63   OrderAccess::release_store_fence(&_should_terminate, true);
    63   OrderAccess::release_store_fence(&_should_terminate, true);
    64 
    64 
    65   stop_service();
    65   stop_service();
    66 
    66 
    67   // Wait for thread to terminate
    67   // Wait for thread to terminate
    68   MonitorLockerEx ml(Terminator_lock);
    68   MonitorLocker ml(Terminator_lock);
    69   while (!_has_terminated) {
    69   while (!_has_terminated) {
    70     ml.wait();
    70     ml.wait();
    71   }
    71   }
    72 }
    72 }
    73 
    73