--- old/src/share/vm/gc/cms/concurrentMarkSweepThread.hpp 2016-03-01 17:46:31.495501302 -0500 +++ new/src/share/vm/gc/cms/concurrentMarkSweepThread.hpp 2016-03-01 17:46:31.351503102 -0500 @@ -37,8 +37,6 @@ friend class VMStructs; friend class ConcurrentMarkSweepGeneration; // XXX should remove friendship friend class CMSCollector; - public: - virtual void run(); private: static ConcurrentMarkSweepThread* _cmst; @@ -47,8 +45,6 @@ static SurrogateLockerThread::SLT_msg_type _sltBuffer; static Monitor* _sltMonitor; - static bool _should_terminate; - enum CMS_flag_type { CMS_nil = NoBits, CMS_cms_wants_token = nth_bit(0), @@ -72,6 +68,9 @@ // debugging void verify_ok_to_terminate() const PRODUCT_RETURN; + void run_service(); + void stop_service(); + public: // Constructor ConcurrentMarkSweepThread(CMSCollector* collector); @@ -86,15 +85,19 @@ static void print_all() { print_all_on(tty); } // Returns the CMS Thread - static ConcurrentMarkSweepThread* cmst() { return _cmst; } + inline static ConcurrentMarkSweepThread* cmst() { + if (_cmst != NULL && !_cmst->_has_terminated) { + return _cmst; + } + return NULL; + } + static CMSCollector* collector() { return _collector; } // Create and start the CMS Thread, or stop it on shutdown static ConcurrentMarkSweepThread* start(CMSCollector* collector); static void stop_all(); - static bool should_terminate() { return _should_terminate; } - // ConcurrentMarkSweepThread uses it's own termination protocol, not ConcurrentGCThread's: - virtual void stop() { ShouldNotReachHere(); } + static bool should_terminate() { return _cmst != NULL && _cmst->_should_terminate; } // Synchronization using CMS token static void synchronize(bool is_cms_thread);