< prev index next >

test/hotspot/jtreg/runtime/whitebox/TestWBDeflateIdleMonitors.java

Print this page
@@ -59,16 +59,15 @@
  
      public static class InflateMonitorsTest {
          static WhiteBox wb = WhiteBox.getWhiteBox();
          public static Object obj;
  
-         public static void main(String args[]) {
+         public static void main(String args[]) throws Exception {
              obj = new Object();
              synchronized (obj) {
-                 // HotSpot implementation detail: asking for the hash code
-                 // when the object is locked causes monitor inflation.
-                 if (obj.hashCode() == 0xBAD) System.out.println("!");
+                 // The current implementation of notify-wait requires inflation.
+                 obj.wait(1);
                  Asserts.assertEQ(wb.isMonitorInflated(obj), true,
                                   "Monitor should be inflated.");
              }
              for (int cnt = 1; cnt <= N_TRIES; cnt++) {
                  System.out.println("Deflation try #" + cnt);
< prev index next >