< prev index next >

src/hotspot/share/gc/g1/g1ServiceThread.cpp

Print this page
rev 60637 : 8252141: Rename G1YoungRemSetSamplingThread to better reflect its purpose
Reviewed-by:

@@ -26,38 +26,38 @@
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1CollectionSet.hpp"
 #include "gc/g1/g1ConcurrentMark.inline.hpp"
 #include "gc/g1/g1ConcurrentMarkThread.inline.hpp"
 #include "gc/g1/g1Policy.hpp"
-#include "gc/g1/g1YoungRemSetSamplingThread.hpp"
+#include "gc/g1/g1ServiceThread.hpp"
 #include "gc/g1/heapRegion.inline.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
 #include "gc/shared/suspendibleThreadSet.hpp"
 #include "memory/universe.hpp"
 #include "runtime/mutexLocker.hpp"
 
-G1YoungRemSetSamplingThread::G1YoungRemSetSamplingThread() :
+G1ServiceThread::G1ServiceThread() :
     ConcurrentGCThread(),
     _monitor(Mutex::nonleaf,
-             "G1YoungRemSetSamplingThread monitor",
+             "G1ServiceThread monitor",
              true,
              Monitor::_safepoint_check_never),
     _last_periodic_gc_attempt_s(os::elapsedTime()),
     _vtime_accum(0) {
-  set_name("G1 Young RemSet Sampling");
+  set_name("G1 Service");
   create_and_start();
 }
 
-void G1YoungRemSetSamplingThread::sleep_before_next_cycle() {
+void G1ServiceThread::sleep_before_next_cycle() {
   MonitorLocker ml(&_monitor, Mutex::_no_safepoint_check_flag);
   if (!should_terminate()) {
     uintx waitms = G1ConcRefinementServiceIntervalMillis;
     ml.wait(waitms);
   }
 }
 
-bool G1YoungRemSetSamplingThread::should_start_periodic_gc() {
+bool G1ServiceThread::should_start_periodic_gc() {
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
   // If we are currently in a concurrent mark we are going to uncommit memory soon.
   if (g1h->concurrent_mark()->cm_thread()->during_cycle()) {
     log_debug(gc, periodic)("Concurrent cycle in progress. Skipping.");
     return false;

@@ -81,11 +81,11 @@
   }
 
   return true;
 }
 
-void G1YoungRemSetSamplingThread::check_for_periodic_gc(){
+void G1ServiceThread::check_for_periodic_gc(){
   // If disabled, just return.
   if (G1PeriodicGCInterval == 0) {
     return;
   }
   if ((os::elapsedTime() - _last_periodic_gc_attempt_s) > (G1PeriodicGCInterval / 1000.0)) {

@@ -97,11 +97,11 @@
     }
     _last_periodic_gc_attempt_s = os::elapsedTime();
   }
 }
 
-void G1YoungRemSetSamplingThread::run_service() {
+void G1ServiceThread::run_service() {
   double vtime_start = os::elapsedVTime();
 
   while (!should_terminate()) {
     sample_young_list_rs_length();
 

@@ -115,11 +115,11 @@
 
     sleep_before_next_cycle();
   }
 }
 
-void G1YoungRemSetSamplingThread::stop_service() {
+void G1ServiceThread::stop_service() {
   MutexLocker x(&_monitor, Mutex::_no_safepoint_check_flag);
   _monitor.notify();
 }
 
 class G1YoungRemSetSamplingClosure : public HeapRegionClosure {

@@ -152,11 +152,11 @@
   }
 
   size_t sampled_rs_length() const { return _sampled_rs_length; }
 };
 
-void G1YoungRemSetSamplingThread::sample_young_list_rs_length() {
+void G1ServiceThread::sample_young_list_rs_length() {
   SuspendibleThreadSetJoiner sts;
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
   G1Policy* policy = g1h->policy();
 
   if (policy->use_adaptive_young_list_length()) {
< prev index next >