< prev index next >

src/hotspot/share/runtime/javaThread.inline.hpp

Print this page

224 inline void JavaThread::set_terminated(TerminatedTypes t) {
225   Atomic::release_store(&_terminated, t);
226 }
227 
228 inline bool JavaThread::is_active_Java_thread() const {
229   return on_thread_list() && !is_terminated();
230 }
231 
232 // Allow tracking of class initialization monitor use
233 inline void JavaThread::set_class_to_be_initialized(InstanceKlass* k) {
234   assert((k == nullptr && _class_to_be_initialized != nullptr) ||
235          (k != nullptr && _class_to_be_initialized == nullptr), "incorrect usage");
236   assert(this == Thread::current(), "Only the current thread can set this field");
237   _class_to_be_initialized = k;
238 }
239 
240 inline InstanceKlass* JavaThread::class_to_be_initialized() const {
241   return _class_to_be_initialized;
242 }
243 
244 inline void JavaThread::set_class_being_initialized(InstanceKlass* k) {
245   assert(k != nullptr || _class_being_initialized != nullptr, "incorrect usage");
246   assert(this == Thread::current(), "Only the current thread can set this field");

247   _class_being_initialized = k;

248 }
249 
250 inline InstanceKlass* JavaThread::class_being_initialized() const {

251   return _class_being_initialized;
252 }
253 
254 inline void JavaThread::om_set_monitor_cache(ObjectMonitor* monitor) {
255   assert(UseObjectMonitorTable, "must be");
256   assert(monitor != nullptr, "use om_clear_monitor_cache to clear");
257   assert(this == current() || monitor->has_owner(this), "only add owned monitors for other threads");
258   assert(this == current() || is_obj_deopt_suspend(), "thread must not run concurrently");
259 
260   _om_cache.set_monitor(monitor);
261 }
262 
263 inline void JavaThread::om_clear_monitor_cache() {
264   if (UseObjectMonitorTable) {
265     _om_cache.clear();
266   }
267 }
268 
269 inline ObjectMonitor* JavaThread::om_get_from_monitor_cache(oop obj) {
270   assert(obj != nullptr, "do not look for null objects");

224 inline void JavaThread::set_terminated(TerminatedTypes t) {
225   Atomic::release_store(&_terminated, t);
226 }
227 
228 inline bool JavaThread::is_active_Java_thread() const {
229   return on_thread_list() && !is_terminated();
230 }
231 
232 // Allow tracking of class initialization monitor use
233 inline void JavaThread::set_class_to_be_initialized(InstanceKlass* k) {
234   assert((k == nullptr && _class_to_be_initialized != nullptr) ||
235          (k != nullptr && _class_to_be_initialized == nullptr), "incorrect usage");
236   assert(this == Thread::current(), "Only the current thread can set this field");
237   _class_to_be_initialized = k;
238 }
239 
240 inline InstanceKlass* JavaThread::class_to_be_initialized() const {
241   return _class_to_be_initialized;
242 }
243 
244 inline InstanceKlass* JavaThread::set_class_being_initialized(InstanceKlass* k) {

245   assert(this == Thread::current(), "Only the current thread can set this field");
246   InstanceKlass* prev = _class_being_initialized;
247   _class_being_initialized = k;
248   return prev;
249 }
250 
251 inline InstanceKlass* JavaThread::class_being_initialized() const {
252   assert(this == Thread::current(), "Only the current thread can get this field");
253   return _class_being_initialized;
254 }
255 
256 inline void JavaThread::om_set_monitor_cache(ObjectMonitor* monitor) {
257   assert(UseObjectMonitorTable, "must be");
258   assert(monitor != nullptr, "use om_clear_monitor_cache to clear");
259   assert(this == current() || monitor->has_owner(this), "only add owned monitors for other threads");
260   assert(this == current() || is_obj_deopt_suspend(), "thread must not run concurrently");
261 
262   _om_cache.set_monitor(monitor);
263 }
264 
265 inline void JavaThread::om_clear_monitor_cache() {
266   if (UseObjectMonitorTable) {
267     _om_cache.clear();
268   }
269 }
270 
271 inline ObjectMonitor* JavaThread::om_get_from_monitor_cache(oop obj) {
272   assert(obj != nullptr, "do not look for null objects");
< prev index next >