src/hotspot/share/prims/jvmtiRawMonitor.cpp
changeset 58196 cea6839598e8
parent 54469 8592226f5cd3
child 58488 165b193b30dd
--- a/src/hotspot/share/prims/jvmtiRawMonitor.cpp	Tue Sep 17 09:20:59 2019 -0700
+++ b/src/hotspot/share/prims/jvmtiRawMonitor.cpp	Tue Sep 17 19:09:37 2019 -0400
@@ -373,8 +373,12 @@
   OrderAccess::fence() ;
 
   // check interrupt event
-  if (interruptible && Thread::is_interrupted(THREAD, true)) {
-    return OM_INTERRUPTED;
+  if (interruptible) {
+    assert(THREAD->is_Java_thread(), "Only JavaThreads can be interruptible");
+    JavaThread* jt = (JavaThread*) THREAD;
+    if (jt->is_interrupted(true)) {
+      return OM_INTERRUPTED;
+    }
   }
 
   intptr_t save = _recursions ;
@@ -401,8 +405,11 @@
   }
   guarantee (THREAD == _owner, "invariant") ;
 
-  if (interruptible && Thread::is_interrupted(THREAD, true)) {
-    return OM_INTERRUPTED;
+  if (interruptible) {
+    JavaThread* jt = (JavaThread*) THREAD;
+    if (jt->is_interrupted(true)) {
+      return OM_INTERRUPTED;
+    }
   }
   return OM_OK ;
 }