< prev index next >
src/hotspot/share/gc/shared/concurrentGCThread.cpp
Print this page
@@ -28,11 +28,10 @@
#include "runtime/mutexLocker.hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/os.hpp"
ConcurrentGCThread::ConcurrentGCThread() :
- _monitor(Monitor::leaf, "ConcurrentGCThread"),
_should_terminate(false),
_has_terminated(false) {}
void ConcurrentGCThread::create_and_start(ThreadPriority prio) {
if (os::create_thread(this, os::cgc_thread)) {
@@ -49,11 +48,11 @@
wait_init_completed();
run_service();
// Signal thread has terminated
- MonitorLockerEx ml(&_monitor);
+ MonitorLockerEx ml(Terminator_lock);
OrderAccess::release_store(&_has_terminated, true);
ml.notify_all();
}
void ConcurrentGCThread::stop() {
@@ -64,11 +63,11 @@
OrderAccess::release_store(&_should_terminate, true);
stop_service();
// Wait for thread to terminate
- MonitorLockerEx ml(&_monitor);
+ MonitorLockerEx ml(Terminator_lock);
while (!_has_terminated) {
ml.wait();
}
}
< prev index next >