< prev index next >

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

Print this page

122   clear_suspend_flag(_obj_deopt);
123 }
124 
125 inline bool JavaThread::clear_async_exception_condition() {
126   bool ret = has_async_exception_condition();
127   clear_suspend_flag(_has_async_exception);
128   return ret;
129 }
130 
131 inline void JavaThread::set_pending_async_exception(oop e) {
132   _pending_async_exception = e;
133   set_suspend_flag(_has_async_exception);
134 }
135 
136 inline void JavaThread::set_pending_unsafe_access_error() {
137   set_suspend_flag(_has_async_exception);
138   DEBUG_ONLY(_is_unsafe_access_error = true);
139 }
140 
141 inline JavaThreadState JavaThread::thread_state() const    {
142 #if defined(PPC64) || defined (AARCH64)
143   // Use membars when accessing volatile _thread_state. See
144   // Threads::create_vm() for size checks.
145   return (JavaThreadState) Atomic::load_acquire((volatile jint*)&_thread_state);
146 #else
147   return _thread_state;
148 #endif
149 }
150 
151 inline void JavaThread::set_thread_state(JavaThreadState s) {
152   assert(current_or_null() == NULL || current_or_null() == this,
153          "state change should only be called by the current thread");
154 #if defined(PPC64) || defined (AARCH64)
155   // Use membars when accessing volatile _thread_state. See
156   // Threads::create_vm() for size checks.
157   Atomic::release_store((volatile jint*)&_thread_state, (jint)s);
158 #else
159   _thread_state = s;
160 #endif
161 }
162 

122   clear_suspend_flag(_obj_deopt);
123 }
124 
125 inline bool JavaThread::clear_async_exception_condition() {
126   bool ret = has_async_exception_condition();
127   clear_suspend_flag(_has_async_exception);
128   return ret;
129 }
130 
131 inline void JavaThread::set_pending_async_exception(oop e) {
132   _pending_async_exception = e;
133   set_suspend_flag(_has_async_exception);
134 }
135 
136 inline void JavaThread::set_pending_unsafe_access_error() {
137   set_suspend_flag(_has_async_exception);
138   DEBUG_ONLY(_is_unsafe_access_error = true);
139 }
140 
141 inline JavaThreadState JavaThread::thread_state() const    {
142 #if defined(PPC64) || defined (AARCH64) || defined(RISCV64)
143   // Use membars when accessing volatile _thread_state. See
144   // Threads::create_vm() for size checks.
145   return (JavaThreadState) Atomic::load_acquire((volatile jint*)&_thread_state);
146 #else
147   return _thread_state;
148 #endif
149 }
150 
151 inline void JavaThread::set_thread_state(JavaThreadState s) {
152   assert(current_or_null() == NULL || current_or_null() == this,
153          "state change should only be called by the current thread");
154 #if defined(PPC64) || defined (AARCH64)
155   // Use membars when accessing volatile _thread_state. See
156   // Threads::create_vm() for size checks.
157   Atomic::release_store((volatile jint*)&_thread_state, (jint)s);
158 #else
159   _thread_state = s;
160 #endif
161 }
162 
< prev index next >