68 // debugging
69 void verify_ok_to_terminate() const PRODUCT_RETURN;
70
71 void run_service();
72 void stop_service();
73
74 public:
75 // Constructor
76 ConcurrentMarkSweepThread(CMSCollector* collector);
77
78 static void makeSurrogateLockerThread(TRAPS);
79 static SurrogateLockerThread* slt() { return _slt; }
80
81 static void threads_do(ThreadClosure* tc);
82
83 // Printing
84 static void print_all_on(outputStream* st);
85 static void print_all() { print_all_on(tty); }
86
87 // Returns the CMS Thread
88 inline static ConcurrentMarkSweepThread* cmst() {
89 if (_cmst != NULL && !_cmst->_has_terminated) {
90 return _cmst;
91 }
92 return NULL;
93 }
94
95 static CMSCollector* collector() { return _collector; }
96
97 // Create and start the CMS Thread, or stop it on shutdown
98 static ConcurrentMarkSweepThread* start(CMSCollector* collector);
99 static void stop_all();
100 static bool should_terminate() { return _cmst != NULL && _cmst->_should_terminate; }
101
102 // Synchronization using CMS token
103 static void synchronize(bool is_cms_thread);
104 static void desynchronize(bool is_cms_thread);
105 static bool vm_thread_has_cms_token() {
106 return CMS_flag_is_set(CMS_vm_has_token);
107 }
108 static bool cms_thread_has_cms_token() {
109 return CMS_flag_is_set(CMS_cms_has_token);
110 }
111 static bool vm_thread_wants_cms_token() {
112 return CMS_flag_is_set(CMS_vm_wants_token);
113 }
114 static bool cms_thread_wants_cms_token() {
115 return CMS_flag_is_set(CMS_cms_wants_token);
116 }
117
118 // Wait on CMS lock until the next synchronous GC
119 // or given timeout, whichever is earlier. A timeout value
120 // of 0 indicates that there is no upper bound on the wait time.
|
68 // debugging
69 void verify_ok_to_terminate() const PRODUCT_RETURN;
70
71 void run_service();
72 void stop_service();
73
74 public:
75 // Constructor
76 ConcurrentMarkSweepThread(CMSCollector* collector);
77
78 static void makeSurrogateLockerThread(TRAPS);
79 static SurrogateLockerThread* slt() { return _slt; }
80
81 static void threads_do(ThreadClosure* tc);
82
83 // Printing
84 static void print_all_on(outputStream* st);
85 static void print_all() { print_all_on(tty); }
86
87 // Returns the CMS Thread
88 static ConcurrentMarkSweepThread* cmst() { return _cmst; }
89 static CMSCollector* collector() { return _collector; }
90
91 // Create and start the CMS Thread, or stop it on shutdown
92 static ConcurrentMarkSweepThread* start(CMSCollector* collector);
93 static void stop_all();
94
95 // Synchronization using CMS token
96 static void synchronize(bool is_cms_thread);
97 static void desynchronize(bool is_cms_thread);
98 static bool vm_thread_has_cms_token() {
99 return CMS_flag_is_set(CMS_vm_has_token);
100 }
101 static bool cms_thread_has_cms_token() {
102 return CMS_flag_is_set(CMS_cms_has_token);
103 }
104 static bool vm_thread_wants_cms_token() {
105 return CMS_flag_is_set(CMS_vm_wants_token);
106 }
107 static bool cms_thread_wants_cms_token() {
108 return CMS_flag_is_set(CMS_cms_wants_token);
109 }
110
111 // Wait on CMS lock until the next synchronous GC
112 // or given timeout, whichever is earlier. A timeout value
113 // of 0 indicates that there is no upper bound on the wait time.
|