< prev index next >

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

Print this page




  91 }
  92 
  93 inline void Thread::set_threads_hazard_ptr(ThreadsList* new_list) {
  94   OrderAccess::release_store_fence(&_threads_hazard_ptr, new_list);
  95 }
  96 
  97 inline void JavaThread::set_ext_suspended() {
  98   set_suspend_flag (_ext_suspended);
  99 }
 100 inline void JavaThread::clear_ext_suspended() {
 101   clear_suspend_flag(_ext_suspended);
 102 }
 103 
 104 inline void JavaThread::set_external_suspend() {
 105   set_suspend_flag(_external_suspend);
 106 }
 107 inline void JavaThread::clear_external_suspend() {
 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;
 148 }
 149 
 150 bool JavaThread::is_at_poll_safepoint() {
 151   return _safepoint_state->is_at_poll_safepoint();
 152 }
 153 
 154 void JavaThread::enter_critical() {
 155   assert(Thread::current() == this ||
 156          (Thread::current()->is_VM_thread() &&
 157          SafepointSynchronize::is_synchronizing()),
 158          "this must be current thread or synchronizing");
 159   _jni_active_critical++;




  91 }
  92 
  93 inline void Thread::set_threads_hazard_ptr(ThreadsList* new_list) {
  94   OrderAccess::release_store_fence(&_threads_hazard_ptr, new_list);
  95 }
  96 
  97 inline void JavaThread::set_ext_suspended() {
  98   set_suspend_flag (_ext_suspended);
  99 }
 100 inline void JavaThread::clear_ext_suspended() {
 101   clear_suspend_flag(_ext_suspended);
 102 }
 103 
 104 inline void JavaThread::set_external_suspend() {
 105   set_suspend_flag(_external_suspend);
 106 }
 107 inline void JavaThread::clear_external_suspend() {
 108   clear_suspend_flag(_external_suspend);
 109 }
 110 
 111 inline void JavaThread::set_deopt_suspend() {
 112   set_suspend_flag(_deopt_suspend);
 113 }
 114 inline void JavaThread::clear_deopt_suspend() {
 115   clear_suspend_flag(_deopt_suspend);
 116 }
 117 
 118 inline void JavaThread::set_pending_async_exception(oop e) {
 119   _pending_async_exception = e;
 120   _special_runtime_exit_condition = _async_exception;
 121   set_has_async_exception();
 122 }
 123 
 124 inline JavaThreadState JavaThread::thread_state() const    {
 125 #if defined(PPC64) || defined (AARCH64)
 126   // Use membars when accessing volatile _thread_state. See
 127   // Threads::create_vm() for size checks.
 128   return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
 129 #else
 130   return _thread_state;
 131 #endif
 132 }
 133 
 134 inline void JavaThread::set_thread_state(JavaThreadState s) {
 135 #if defined(PPC64) || defined (AARCH64)
 136   // Use membars when accessing volatile _thread_state. See
 137   // Threads::create_vm() for size checks.
 138   OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
 139 #else
 140   _thread_state = s;
 141 #endif





 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;
 150 }
 151 
 152 bool JavaThread::is_at_poll_safepoint() {
 153   return _safepoint_state->is_at_poll_safepoint();
 154 }
 155 
 156 void JavaThread::enter_critical() {
 157   assert(Thread::current() == this ||
 158          (Thread::current()->is_VM_thread() &&
 159          SafepointSynchronize::is_synchronizing()),
 160          "this must be current thread or synchronizing");
 161   _jni_active_critical++;


< prev index next >