< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java

Print this page
*** 53,10 ***
--- 53,12 ---
      f = type.getField("_next_om");
      nextOMFieldOffset = f.getOffset();
      contentionsField  = type.getJIntField("_contentions");
      waitersField = type.getJIntField("_waiters");
      recursionsField = type.getCIntegerField("_recursions");
+ 
+     ANONYMOUS_OWNER = db.lookupLongConstant("ObjectMonitor::ANONYMOUS_OWNER").longValue();
    }
  
    public ObjectMonitor(Address addr) {
      super(addr);
    }

*** 77,10 ***
--- 79,14 ---
        return true;
      }
      return false;
    }
  
+   public boolean isOwnedAnonymous() {
+     return addr.getAddressAt(ownerFieldOffset).asLongValue() == ANONYMOUS_OWNER;
+   }
+ 
    public Address owner() { return addr.getAddressAt(ownerFieldOffset); }
    // FIXME
    //  void      set_owner(void* owner);
  
    public int    waiters() { return waitersField.getValue(addr); }

*** 112,7 ***
--- 118,9 ---
    private static long          ownerFieldOffset;
    private static long          nextOMFieldOffset;
    private static JIntField     contentionsField;
    private static JIntField     waitersField;
    private static CIntegerField recursionsField;
+   private static long          ANONYMOUS_OWNER;
+ 
    // FIXME: expose platform-dependent stuff
  }
< prev index next >