File tree 2 files changed +10
-5
lines changed
src/hotspot/share/runtime
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 29
29
// No interfaceSupport.hpp
30
30
31
31
#include " gc/shared/gc_globals.hpp"
32
+ #include " runtime/globals.hpp"
32
33
#include " runtime/handles.inline.hpp"
33
34
#include " runtime/javaThread.inline.hpp"
34
35
#include " runtime/mutexLocker.hpp"
@@ -97,7 +98,11 @@ class ThreadStateTransition : public StackObj {
97
98
assert (to == _thread_in_vm || to == _thread_in_Java, " invalid transition" );
98
99
assert (!thread->has_last_Java_frame () || thread->frame_anchor ()->walkable (), " Unwalkable stack in native transition" );
99
100
100
- thread->set_thread_state_fence (_thread_in_vm);
101
+ if (!UseSystemMemoryBarrier) {
102
+ thread->set_thread_state_fence (_thread_in_vm);
103
+ } else {
104
+ thread->set_thread_state (_thread_in_vm);
105
+ }
101
106
SafepointMechanism::process_if_requested_with_exit_check (thread, to != _thread_in_Java ? false : check_asyncs);
102
107
thread->set_thread_state (to);
103
108
}
Original file line number Diff line number Diff line change @@ -145,9 +145,9 @@ inline JavaThreadState JavaThread::thread_state() const {
145
145
#if defined(PPC64) || defined (AARCH64) || defined(RISCV64)
146
146
// Use membars when accessing volatile _thread_state. See
147
147
// Threads::create_vm() for size checks.
148
- return (JavaThreadState) Atomic::load_acquire (( volatile jint*) &_thread_state);
148
+ return Atomic::load_acquire (&_thread_state);
149
149
#else
150
- return _thread_state;
150
+ return Atomic::load (& _thread_state) ;
151
151
#endif
152
152
}
153
153
@@ -157,9 +157,9 @@ inline void JavaThread::set_thread_state(JavaThreadState s) {
157
157
#if defined(PPC64) || defined (AARCH64) || defined(RISCV64)
158
158
// Use membars when accessing volatile _thread_state. See
159
159
// Threads::create_vm() for size checks.
160
- Atomic::release_store (( volatile jint*) &_thread_state, (jint) s);
160
+ Atomic::release_store (&_thread_state, s);
161
161
#else
162
- _thread_state = s ;
162
+ Atomic::store (& _thread_state, s) ;
163
163
#endif
164
164
}
165
165
You can’t perform that action at this time.
0 commit comments