8218147: make_walkable asserts on multiple calls
authorrehn
Wed, 17 Apr 2019 09:25:27 +0200
changeset 54562 1af5c0e68381
parent 54561 6c4d8b7128d5
child 54563 ba8ab3f67aec
8218147: make_walkable asserts on multiple calls Reviewed-by: dholmes, dcubed
src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
src/hotspot/share/runtime/thread.hpp
--- 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