src/share/vm/runtime/thread.hpp

Print this page
rev 5729 : 8029396: PPC64 (part 212): Several memory ordering fixes in C-code.


1027 
1028 
1029   ThreadFunction entry_point() const             { return _entry_point; }
1030 
1031   // Allocates a new Java level thread object for this thread. thread_name may be NULL.
1032   void allocate_threadObj(Handle thread_group, char* thread_name, bool daemon, TRAPS);
1033 
1034   // Last frame anchor routines
1035 
1036   JavaFrameAnchor* frame_anchor(void)                { return &_anchor; }
1037 
1038   // last_Java_sp
1039   bool has_last_Java_frame() const                   { return _anchor.has_last_Java_frame(); }
1040   intptr_t* last_Java_sp() const                     { return _anchor.last_Java_sp(); }
1041 
1042   // last_Java_pc
1043 
1044   address last_Java_pc(void)                         { return _anchor.last_Java_pc(); }
1045 
1046   // Safepoint support
1047   JavaThreadState thread_state() const           { return _thread_state; }
1048   void set_thread_state(JavaThreadState s)       { _thread_state=s;      }






1049   ThreadSafepointState *safepoint_state() const  { return _safepoint_state;  }
1050   void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
1051   bool is_at_poll_safepoint()                    { return _safepoint_state->is_at_poll_safepoint(); }
1052 
1053   // thread has called JavaThread::exit() or is terminated
1054   bool is_exiting()                              { return _terminated == _thread_exiting || is_terminated(); }
1055   // thread is terminated (no longer on the threads list); we compare
1056   // against the two non-terminated values so that a freed JavaThread
1057   // will also be considered terminated.
1058   bool is_terminated()                           { return _terminated != _not_terminated && _terminated != _thread_exiting; }
1059   void set_terminated(TerminatedTypes t)         { _terminated = t; }
1060   // special for Threads::remove() which is static:
1061   void set_terminated_value()                    { _terminated = _thread_terminated; }
1062   void block_if_vm_exited();
1063 
1064   bool doing_unsafe_access()                     { return _doing_unsafe_access; }
1065   void set_doing_unsafe_access(bool val)         { _doing_unsafe_access = val; }
1066 
1067   bool do_not_unlock_if_synchronized()             { return _do_not_unlock_if_synchronized; }
1068   void set_do_not_unlock_if_synchronized(bool val) { _do_not_unlock_if_synchronized = val; }




1027 
1028 
1029   ThreadFunction entry_point() const             { return _entry_point; }
1030 
1031   // Allocates a new Java level thread object for this thread. thread_name may be NULL.
1032   void allocate_threadObj(Handle thread_group, char* thread_name, bool daemon, TRAPS);
1033 
1034   // Last frame anchor routines
1035 
1036   JavaFrameAnchor* frame_anchor(void)                { return &_anchor; }
1037 
1038   // last_Java_sp
1039   bool has_last_Java_frame() const                   { return _anchor.has_last_Java_frame(); }
1040   intptr_t* last_Java_sp() const                     { return _anchor.last_Java_sp(); }
1041 
1042   // last_Java_pc
1043 
1044   address last_Java_pc(void)                         { return _anchor.last_Java_pc(); }
1045 
1046   // Safepoint support
1047   // Use membars when accessing volatile _thread_state. See
1048   // Threads::create_vm() for size checks.
1049   JavaThreadState thread_state() const           {
1050     return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
1051   }
1052   void set_thread_state(JavaThreadState s)       {
1053     OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
1054   }
1055   ThreadSafepointState *safepoint_state() const  { return _safepoint_state;  }
1056   void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
1057   bool is_at_poll_safepoint()                    { return _safepoint_state->is_at_poll_safepoint(); }
1058 
1059   // thread has called JavaThread::exit() or is terminated
1060   bool is_exiting()                              { return _terminated == _thread_exiting || is_terminated(); }
1061   // thread is terminated (no longer on the threads list); we compare
1062   // against the two non-terminated values so that a freed JavaThread
1063   // will also be considered terminated.
1064   bool is_terminated()                           { return _terminated != _not_terminated && _terminated != _thread_exiting; }
1065   void set_terminated(TerminatedTypes t)         { _terminated = t; }
1066   // special for Threads::remove() which is static:
1067   void set_terminated_value()                    { _terminated = _thread_terminated; }
1068   void block_if_vm_exited();
1069 
1070   bool doing_unsafe_access()                     { return _doing_unsafe_access; }
1071   void set_doing_unsafe_access(bool val)         { _doing_unsafe_access = val; }
1072 
1073   bool do_not_unlock_if_synchronized()             { return _do_not_unlock_if_synchronized; }
1074   void set_do_not_unlock_if_synchronized(bool val) { _do_not_unlock_if_synchronized = val; }