--- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp Wed Apr 17 12:43:41 2019 +0530
+++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp Wed Apr 17 09:25:27 2019 +0200
@@ -359,7 +359,7 @@
}
bool ret = false;
- thread->set_trace_flag();
+ thread->set_trace_flag(); // Provides StoreLoad, needed to keep read of thread state from floating up.
if (JAVA_SAMPLE == type) {
if (thread_state_in_java(thread)) {
ret = sample_thread_in_java(thread, frames, max_frames);
--- a/src/hotspot/share/runtime/thread.hpp Wed Apr 17 12:43:41 2019 +0530
+++ b/src/hotspot/share/runtime/thread.hpp Wed Apr 17 09:25:27 2019 +0200
@@ -1415,7 +1415,7 @@
// Whenever a thread transitions from native to vm/java it must suspend
// if external|deopt suspend is present.
bool is_suspend_after_native() const {
- return (_suspend_flags & (_external_suspend | _deopt_suspend)) != 0;
+ return (_suspend_flags & (_external_suspend | _deopt_suspend JFR_ONLY(| _trace_flag))) != 0;
}
// external suspend request is completed