--- old/src/hotspot/share/gc/shared/concurrentGCThread.cpp 2019-03-27 14:17:37.583202603 +0100 +++ new/src/hotspot/share/gc/shared/concurrentGCThread.cpp 2019-03-27 14:17:37.244191513 +0100 @@ -30,7 +30,6 @@ #include "runtime/os.hpp" ConcurrentGCThread::ConcurrentGCThread() : - _monitor(Monitor::leaf, "ConcurrentGCThread"), _should_terminate(false), _has_terminated(false) {} @@ -51,7 +50,7 @@ run_service(); // Signal thread has terminated - MonitorLockerEx ml(&_monitor); + MonitorLockerEx ml(Terminator_lock); OrderAccess::release_store(&_has_terminated, true); ml.notify_all(); } @@ -66,7 +65,7 @@ stop_service(); // Wait for thread to terminate - MonitorLockerEx ml(&_monitor); + MonitorLockerEx ml(Terminator_lock); while (!_has_terminated) { ml.wait(); } --- old/src/hotspot/share/gc/shared/concurrentGCThread.hpp 2019-03-27 14:17:38.087219088 +0100 +++ new/src/hotspot/share/gc/shared/concurrentGCThread.hpp 2019-03-27 14:17:37.748208000 +0100 @@ -25,12 +25,10 @@ #ifndef SHARE_GC_SHARED_CONCURRENTGCTHREAD_HPP #define SHARE_GC_SHARED_CONCURRENTGCTHREAD_HPP -#include "runtime/mutex.hpp" #include "runtime/thread.hpp" class ConcurrentGCThread: public NamedThread { private: - Monitor _monitor; volatile bool _should_terminate; volatile bool _has_terminated; --- old/src/hotspot/share/runtime/thread.cpp 2019-03-27 14:17:38.570234888 +0100 +++ new/src/hotspot/share/runtime/thread.cpp 2019-03-27 14:17:38.223223537 +0100 @@ -1506,7 +1506,7 @@ { MutexLockerEx mu(Terminator_lock, Mutex::_no_safepoint_check_flag); _watcher_thread = NULL; - Terminator_lock->notify(); + Terminator_lock->notify_all(); } }