< prev index next >

src/share/vm/gc/shared/concurrentGCThread.hpp

Print this page
rev 10389 : imported patch webrev.01
rev 10390 : imported patch webrev.02
rev 10391 : [mq]: webrev.03
rev 10392 : imported patch webrev.04

@@ -29,16 +29,16 @@
 #include "utilities/macros.hpp"
 
 class ConcurrentGCThread: public NamedThread {
   friend class VMStructs;
 
-protected:
   bool volatile _should_terminate;
   bool _has_terminated;
 
-  // Create and start the thread (setting it's priority high.)
-  void create_and_start();
+protected:
+  // Create and start the thread (setting it's priority.)
+  void create_and_start(ThreadPriority prio = NearMaxPriority);
 
   // Do initialization steps in the thread: record stack base and size,
   // init thread local storage, set JNI handle block.
   void initialize_in_thread();
 

@@ -47,15 +47,29 @@
 
   // Record that the current thread is terminating, and will do more
   // concurrent work.
   void terminate();
 
+  // Do the specific GC work. Called by run() after initialization complete.
+  virtual void run_service() = 0;
+
+  // Shut down the specific GC work. Called by stop() as part of termination protocol.
+  virtual void stop_service()  = 0;
+
 public:
   ConcurrentGCThread();
 
   // Tester
   bool is_ConcurrentGC_thread() const { return true; }
+
+  virtual void run();
+
+  // shutdown following termination protocol
+  virtual void stop();
+  
+  bool should_terminate() { return _should_terminate; }
+  bool has_terminated()   { return _has_terminated; }
 };
 
 // The SurrogateLockerThread is used by concurrent GC threads for
 // manipulating Java monitors, in particular, currently for
 // manipulating the pending_list_lock. XXX
< prev index next >