--- old/src/share/vm/gc/shared/concurrentGCThread.cpp 2016-02-24 13:41:11.035424221 -0500 +++ new/src/share/vm/gc/shared/concurrentGCThread.cpp 2016-02-24 13:41:10.890426033 -0500 @@ -75,6 +75,32 @@ } } +void ConcurrentGCThread::run() { + initialize_in_thread(); + wait_for_universe_init(); + + run_service(); + + terminate(); +} + +void ConcurrentGCThread::stop() { + // it is ok to take late safepoints here, if needed + { + MutexLockerEx mu(Terminator_lock); + _should_terminate = true; + } + + stop_service(); + + { + MutexLockerEx mu(Terminator_lock); + while (!_has_terminated) { + Terminator_lock->wait(); + } + } +} + static void _sltLoop(JavaThread* thread, TRAPS) { SurrogateLockerThread* slt = (SurrogateLockerThread*)thread; slt->loop();