src/share/vm/runtime/thread.inline.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


 105 inline void JavaThread::set_external_suspend() {
 106   set_suspend_flag(_external_suspend);
 107 }
 108 inline void JavaThread::clear_external_suspend() {
 109   clear_suspend_flag(_external_suspend);
 110 }
 111 
 112 inline void JavaThread::set_deopt_suspend() {
 113   set_suspend_flag(_deopt_suspend);
 114 }
 115 inline void JavaThread::clear_deopt_suspend() {
 116   clear_suspend_flag(_deopt_suspend);
 117 }
 118 
 119 inline void JavaThread::set_pending_async_exception(oop e) {
 120   _pending_async_exception = e;
 121   _special_runtime_exit_condition = _async_exception;
 122   set_has_async_exception();
 123 }
 124 
 125 #ifdef PPC64
 126 inline JavaThreadState JavaThread::thread_state() const    {
 127   return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
 128 }
 129 
 130 inline void JavaThread::set_thread_state(JavaThreadState s) {
 131   OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
 132 }
 133 #endif
 134 
 135 inline void JavaThread::set_done_attaching_via_jni() {
 136   _jni_attach_state = _attached_via_jni;
 137   OrderAccess::fence();
 138 }
 139 
 140 inline bool JavaThread::stack_guard_zone_unused() {
 141   return _stack_guard_state == stack_guard_unused;
 142 }
 143 
 144 inline bool JavaThread::stack_yellow_zone_disabled() {
 145   return _stack_guard_state == stack_guard_yellow_disabled;




 105 inline void JavaThread::set_external_suspend() {
 106   set_suspend_flag(_external_suspend);
 107 }
 108 inline void JavaThread::clear_external_suspend() {
 109   clear_suspend_flag(_external_suspend);
 110 }
 111 
 112 inline void JavaThread::set_deopt_suspend() {
 113   set_suspend_flag(_deopt_suspend);
 114 }
 115 inline void JavaThread::clear_deopt_suspend() {
 116   clear_suspend_flag(_deopt_suspend);
 117 }
 118 
 119 inline void JavaThread::set_pending_async_exception(oop e) {
 120   _pending_async_exception = e;
 121   _special_runtime_exit_condition = _async_exception;
 122   set_has_async_exception();
 123 }
 124 
 125 #if defined(PPC64) || defined (AARCH64)
 126 inline JavaThreadState JavaThread::thread_state() const    {
 127   return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
 128 }
 129 
 130 inline void JavaThread::set_thread_state(JavaThreadState s) {
 131   OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
 132 }
 133 #endif
 134 
 135 inline void JavaThread::set_done_attaching_via_jni() {
 136   _jni_attach_state = _attached_via_jni;
 137   OrderAccess::fence();
 138 }
 139 
 140 inline bool JavaThread::stack_guard_zone_unused() {
 141   return _stack_guard_state == stack_guard_unused;
 142 }
 143 
 144 inline bool JavaThread::stack_yellow_zone_disabled() {
 145   return _stack_guard_state == stack_guard_yellow_disabled;