src/hotspot/share/runtime/thread.inline.hpp
changeset 52673 61b3b58a1d1d
parent 50921 7f462e8383f6
child 53244 9807daeb47c4
equal deleted inserted replaced
52672:bbfa1b3aaf7e 52673:61b3b58a1d1d
    27 
    27 
    28 #include "runtime/atomic.hpp"
    28 #include "runtime/atomic.hpp"
    29 #include "runtime/globals.hpp"
    29 #include "runtime/globals.hpp"
    30 #include "runtime/orderAccess.hpp"
    30 #include "runtime/orderAccess.hpp"
    31 #include "runtime/os.inline.hpp"
    31 #include "runtime/os.inline.hpp"
       
    32 #include "runtime/safepoint.hpp"
    32 #include "runtime/thread.hpp"
    33 #include "runtime/thread.hpp"
    33 
    34 
    34 inline void Thread::set_suspend_flag(SuspendFlags f) {
    35 inline void Thread::set_suspend_flag(SuspendFlags f) {
    35   uint32_t flags;
    36   uint32_t flags;
    36   do {
    37   do {
   128 inline void JavaThread::set_thread_state(JavaThreadState s) {
   129 inline void JavaThread::set_thread_state(JavaThreadState s) {
   129   OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
   130   OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
   130 }
   131 }
   131 #endif
   132 #endif
   132 
   133 
       
   134 ThreadSafepointState* JavaThread::safepoint_state() const  {
       
   135   return _safepoint_state;
       
   136 }
       
   137 
       
   138 void JavaThread::set_safepoint_state(ThreadSafepointState *state) {
       
   139   _safepoint_state = state;
       
   140 }
       
   141 
       
   142 bool JavaThread::is_at_poll_safepoint() {
       
   143   return _safepoint_state->is_at_poll_safepoint();
       
   144 }
       
   145 
       
   146 void JavaThread::enter_critical() {
       
   147   assert(Thread::current() == this ||
       
   148          (Thread::current()->is_VM_thread() &&
       
   149          SafepointSynchronize::is_synchronizing()),
       
   150          "this must be current thread or synchronizing");
       
   151   _jni_active_critical++;
       
   152 }
       
   153 
   133 inline void JavaThread::set_done_attaching_via_jni() {
   154 inline void JavaThread::set_done_attaching_via_jni() {
   134   _jni_attach_state = _attached_via_jni;
   155   _jni_attach_state = _attached_via_jni;
   135   OrderAccess::fence();
   156   OrderAccess::fence();
   136 }
   157 }
   137 
   158