src/hotspot/share/prims/jvmtiThreadState.inline.hpp
changeset 57745 789e967c2731
parent 53244 9807daeb47c4
--- a/src/hotspot/share/prims/jvmtiThreadState.inline.hpp	Wed Aug 14 11:14:54 2019 +0100
+++ b/src/hotspot/share/prims/jvmtiThreadState.inline.hpp	Wed Aug 14 10:07:00 2019 -0400
@@ -90,7 +90,9 @@
     // check again with the lock held
     state = state_for_while_locked(thread);
   } else {
-    CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
+    // Check possible safepoint even if state is non-null.
+    // (Note: the thread argument isn't the current thread)
+    DEBUG_ONLY(JavaThread::current()->check_possible_safepoint());
   }
   return state;
 }