< prev index next >

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

Print this page




 108   clear_suspend_flag(_external_suspend);
 109 }
 110 
 111 inline void JavaThread::set_pending_async_exception(oop e) {
 112   _pending_async_exception = e;
 113   _special_runtime_exit_condition = _async_exception;
 114   set_has_async_exception();
 115 }
 116 
 117 inline JavaThreadState JavaThread::thread_state() const    {
 118 #if defined(PPC64) || defined (AARCH64)
 119   // Use membars when accessing volatile _thread_state. See
 120   // Threads::create_vm() for size checks.
 121   return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
 122 #else
 123   return _thread_state;
 124 #endif
 125 }
 126 
 127 inline void JavaThread::set_thread_state(JavaThreadState s) {


 128 #if defined(PPC64) || defined (AARCH64)
 129   // Use membars when accessing volatile _thread_state. See
 130   // Threads::create_vm() for size checks.
 131   OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
 132 #else
 133   _thread_state = s;
 134 #endif
 135 }
 136 
 137 inline void JavaThread::set_thread_state_fence(JavaThreadState s) {
 138   set_thread_state(s);
 139   OrderAccess::fence();
 140 }
 141 
 142 ThreadSafepointState* JavaThread::safepoint_state() const  {
 143   return _safepoint_state;
 144 }
 145 
 146 void JavaThread::set_safepoint_state(ThreadSafepointState *state) {
 147   _safepoint_state = state;




 108   clear_suspend_flag(_external_suspend);
 109 }
 110 
 111 inline void JavaThread::set_pending_async_exception(oop e) {
 112   _pending_async_exception = e;
 113   _special_runtime_exit_condition = _async_exception;
 114   set_has_async_exception();
 115 }
 116 
 117 inline JavaThreadState JavaThread::thread_state() const    {
 118 #if defined(PPC64) || defined (AARCH64)
 119   // Use membars when accessing volatile _thread_state. See
 120   // Threads::create_vm() for size checks.
 121   return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
 122 #else
 123   return _thread_state;
 124 #endif
 125 }
 126 
 127 inline void JavaThread::set_thread_state(JavaThreadState s) {
 128   assert(current_or_null() == NULL || current_or_null() == this,
 129          "state change should only be called by the current thread");
 130 #if defined(PPC64) || defined (AARCH64)
 131   // Use membars when accessing volatile _thread_state. See
 132   // Threads::create_vm() for size checks.
 133   OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
 134 #else
 135   _thread_state = s;
 136 #endif
 137 }
 138 
 139 inline void JavaThread::set_thread_state_fence(JavaThreadState s) {
 140   set_thread_state(s);
 141   OrderAccess::fence();
 142 }
 143 
 144 ThreadSafepointState* JavaThread::safepoint_state() const  {
 145   return _safepoint_state;
 146 }
 147 
 148 void JavaThread::set_safepoint_state(ThreadSafepointState *state) {
 149   _safepoint_state = state;


< prev index next >