diff -r 046e4024e55a -r 76ae9aa0e794 src/hotspot/share/classfile/javaClasses.cpp --- a/src/hotspot/share/classfile/javaClasses.cpp Fri Nov 15 09:06:58 2019 +0800 +++ b/src/hotspot/share/classfile/javaClasses.cpp Thu Nov 14 22:36:40 2019 -0500 @@ -1708,10 +1708,20 @@ } bool java_lang_Thread::interrupted(oop java_thread) { + // Make sure the caller can safely access oops. + assert(Thread::current()->is_VM_thread() || + (JavaThread::current()->thread_state() != _thread_blocked && + JavaThread::current()->thread_state() != _thread_in_native), + "Unsafe access to oop"); return java_thread->bool_field_volatile(_interrupted_offset); } void java_lang_Thread::set_interrupted(oop java_thread, bool val) { + // Make sure the caller can safely access oops. + assert(Thread::current()->is_VM_thread() || + (JavaThread::current()->thread_state() != _thread_blocked && + JavaThread::current()->thread_state() != _thread_in_native), + "Unsafe access to oop"); java_thread->bool_field_put_volatile(_interrupted_offset, val); }