142 static void print_safepoint_timeout(SafepointTimeoutReason timeout_reason);
143
144 public:
145
146 // Main entry points
147
148 // Roll all threads forward to safepoint. Must be called by the
149 // VMThread or CMS_thread.
150 static void begin();
151 static void end(); // Start all suspended threads again...
152
153 static bool safepoint_safe(JavaThread *thread, JavaThreadState state);
154
155 static void check_for_lazy_critical_native(JavaThread *thread, JavaThreadState state);
156
157 // Query
158 inline static bool is_at_safepoint() { return _state == _synchronized; }
159 inline static bool is_synchronizing() { return _state == _synchronizing; }
160 inline static int safepoint_counter() { return _safepoint_counter; }
161
162 inline static bool do_call_back() {
163 return (_state != _not_synchronized);
164 }
165
166 inline static void increment_jni_active_count() {
167 assert_locked_or_safepoint(Safepoint_lock);
168 _current_jni_active_count++;
169 }
170
171 // Called when a thread voluntarily blocks
172 static void block(JavaThread *thread);
173 static void signal_thread_at_safepoint() { _waiting_to_block--; }
174
175 // Exception handling for page polling
176 static void handle_polling_page_exception(JavaThread *thread);
177
178 // VM Thread interface for determining safepoint rate
179 static long last_non_safepoint_interval() {
180 return os::javaTimeMillis() - _end_of_last_safepoint;
181 }
182 static long end_of_last_safepoint() {
183 return _end_of_last_safepoint;
184 }
185 static bool is_cleanup_needed();
186 static void do_cleanup_tasks();
187
188 // Debugging
189 static void print_state() PRODUCT_RETURN;
190 static void safepoint_msg(const char* format, ...) ATTRIBUTE_PRINTF(1, 2) PRODUCT_RETURN;
191
192 static void deferred_initialize_stat();
|
142 static void print_safepoint_timeout(SafepointTimeoutReason timeout_reason);
143
144 public:
145
146 // Main entry points
147
148 // Roll all threads forward to safepoint. Must be called by the
149 // VMThread or CMS_thread.
150 static void begin();
151 static void end(); // Start all suspended threads again...
152
153 static bool safepoint_safe(JavaThread *thread, JavaThreadState state);
154
155 static void check_for_lazy_critical_native(JavaThread *thread, JavaThreadState state);
156
157 // Query
158 inline static bool is_at_safepoint() { return _state == _synchronized; }
159 inline static bool is_synchronizing() { return _state == _synchronizing; }
160 inline static int safepoint_counter() { return _safepoint_counter; }
161
162 inline static void increment_jni_active_count() {
163 assert_locked_or_safepoint(Safepoint_lock);
164 _current_jni_active_count++;
165 }
166
167 private:
168 inline static bool do_call_back() {
169 return (_state != _not_synchronized);
170 }
171
172 // Called when a thread voluntarily blocks
173 static void block(JavaThread *thread);
174
175 friend class SafepointMechanism;
176
177 public:
178 static void signal_thread_at_safepoint() { _waiting_to_block--; }
179
180 // Exception handling for page polling
181 static void handle_polling_page_exception(JavaThread *thread);
182
183 // VM Thread interface for determining safepoint rate
184 static long last_non_safepoint_interval() {
185 return os::javaTimeMillis() - _end_of_last_safepoint;
186 }
187 static long end_of_last_safepoint() {
188 return _end_of_last_safepoint;
189 }
190 static bool is_cleanup_needed();
191 static void do_cleanup_tasks();
192
193 // Debugging
194 static void print_state() PRODUCT_RETURN;
195 static void safepoint_msg(const char* format, ...) ATTRIBUTE_PRINTF(1, 2) PRODUCT_RETURN;
196
197 static void deferred_initialize_stat();
|