< prev index next >

src/hotspot/share/prims/jvmtiEnvBase.cpp

Print this page
rev 59470 : 8153224.v2.1[12].patch merged with 8153224.v2.13.patch.

@@ -651,10 +651,13 @@
   JavaThread *current_jt = JavaThread::current();
   assert(current_jt == java_thread ||
          current_jt == java_thread->active_handshaker(),
          "call by myself or at direct handshake");
   oop obj = NULL;
+  // The ObjectMonitor* can't be async deflated since we are either
+  // at a safepoint or the calling thread is operating on itself so
+  // it cannot leave the underlying wait()/enter() call.
   ObjectMonitor *mon = java_thread->current_waiting_monitor();
   if (mon == NULL) {
     // thread is not doing an Object.wait() call
     mon = java_thread->current_pending_monitor();
     if (mon != NULL) {

@@ -728,19 +731,25 @@
   }
 
   HandleMark hm;
   oop wait_obj = NULL;
   {
-    // save object of current wait() call (if any) for later comparison
+    // The ObjectMonitor* can't be async deflated since we are either
+    // at a safepoint or the calling thread is operating on itself so
+    // it cannot leave the underlying wait() call.
+    // Save object of current wait() call (if any) for later comparison.
     ObjectMonitor *mon = java_thread->current_waiting_monitor();
     if (mon != NULL) {
       wait_obj = (oop)mon->object();
     }
   }
   oop pending_obj = NULL;
   {
-    // save object of current enter() call (if any) for later comparison
+    // The ObjectMonitor* can't be async deflated since we are either
+    // at a safepoint or the calling thread is operating on itself so
+    // it cannot leave the underlying enter() call.
+    // Save object of current enter() call (if any) for later comparison.
     ObjectMonitor *mon = java_thread->current_pending_monitor();
     if (mon != NULL) {
       pending_obj = (oop)mon->object();
     }
   }
< prev index next >