src/share/vm/runtime/thread.hpp

Print this page
rev 7516 : 8069593: AARCH64: Changes to JavaThread::_thread_state must use acquire and release
Summary: Use release stores for all changes to thread state.
Reviewed-by: kvn


 999 
1000 
1001   ThreadFunction entry_point() const             { return _entry_point; }
1002 
1003   // Allocates a new Java level thread object for this thread. thread_name may be NULL.
1004   void allocate_threadObj(Handle thread_group, const char* thread_name, bool daemon, TRAPS);
1005 
1006   // Last frame anchor routines
1007 
1008   JavaFrameAnchor* frame_anchor(void)            { return &_anchor; }
1009 
1010   // last_Java_sp
1011   bool has_last_Java_frame() const               { return _anchor.has_last_Java_frame(); }
1012   intptr_t* last_Java_sp() const                 { return _anchor.last_Java_sp(); }
1013 
1014   // last_Java_pc
1015 
1016   address last_Java_pc(void)                     { return _anchor.last_Java_pc(); }
1017 
1018   // Safepoint support
1019 #ifndef PPC64
1020   JavaThreadState thread_state() const           { return _thread_state; }
1021   void set_thread_state(JavaThreadState s)       { _thread_state = s;    }
1022 #else
1023   // Use membars when accessing volatile _thread_state. See
1024   // Threads::create_vm() for size checks.
1025   inline JavaThreadState thread_state() const;
1026   inline void set_thread_state(JavaThreadState s);
1027 #endif
1028   ThreadSafepointState *safepoint_state() const  { return _safepoint_state; }
1029   void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
1030   bool is_at_poll_safepoint()                    { return _safepoint_state->is_at_poll_safepoint(); }
1031 
1032   // thread has called JavaThread::exit() or is terminated
1033   bool is_exiting()                              { return _terminated == _thread_exiting || is_terminated(); }
1034   // thread is terminated (no longer on the threads list); we compare
1035   // against the two non-terminated values so that a freed JavaThread
1036   // will also be considered terminated.
1037   bool is_terminated()                           { return _terminated != _not_terminated && _terminated != _thread_exiting; }
1038   void set_terminated(TerminatedTypes t)         { _terminated = t; }
1039   // special for Threads::remove() which is static:




 999 
1000 
1001   ThreadFunction entry_point() const             { return _entry_point; }
1002 
1003   // Allocates a new Java level thread object for this thread. thread_name may be NULL.
1004   void allocate_threadObj(Handle thread_group, const char* thread_name, bool daemon, TRAPS);
1005 
1006   // Last frame anchor routines
1007 
1008   JavaFrameAnchor* frame_anchor(void)            { return &_anchor; }
1009 
1010   // last_Java_sp
1011   bool has_last_Java_frame() const               { return _anchor.has_last_Java_frame(); }
1012   intptr_t* last_Java_sp() const                 { return _anchor.last_Java_sp(); }
1013 
1014   // last_Java_pc
1015 
1016   address last_Java_pc(void)                     { return _anchor.last_Java_pc(); }
1017 
1018   // Safepoint support
1019 #if ! (defined(PPC64) || defined(AARCH64))
1020   JavaThreadState thread_state() const           { return _thread_state; }
1021   void set_thread_state(JavaThreadState s)       { _thread_state = s;    }
1022 #else
1023   // Use membars when accessing volatile _thread_state. See
1024   // Threads::create_vm() for size checks.
1025   inline JavaThreadState thread_state() const;
1026   inline void set_thread_state(JavaThreadState s);
1027 #endif
1028   ThreadSafepointState *safepoint_state() const  { return _safepoint_state; }
1029   void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
1030   bool is_at_poll_safepoint()                    { return _safepoint_state->is_at_poll_safepoint(); }
1031 
1032   // thread has called JavaThread::exit() or is terminated
1033   bool is_exiting()                              { return _terminated == _thread_exiting || is_terminated(); }
1034   // thread is terminated (no longer on the threads list); we compare
1035   // against the two non-terminated values so that a freed JavaThread
1036   // will also be considered terminated.
1037   bool is_terminated()                           { return _terminated != _not_terminated && _terminated != _thread_exiting; }
1038   void set_terminated(TerminatedTypes t)         { _terminated = t; }
1039   // special for Threads::remove() which is static: