--- old/src/hotspot/share/runtime/thread.inline.hpp 2019-11-22 14:30:47.189725988 -0500 +++ new/src/hotspot/share/runtime/thread.inline.hpp 2019-11-22 14:30:46.897718333 -0500 @@ -125,6 +125,8 @@ } inline void JavaThread::set_thread_state(JavaThreadState s) { + assert(current_or_null() == NULL || current_or_null() == this, + "state change should only be called by the current thread"); #if defined(PPC64) || defined (AARCH64) // Use membars when accessing volatile _thread_state. See // Threads::create_vm() for size checks.