< prev index next >

test/compiler/testlibrary/rtm/BusyLock.java

Print this page
rev 7600 : 8050486: compiler/rtm/ tests fail due to monitor deflation at safepoint synchronization
Reviewed-by:

@@ -75,18 +75,22 @@
         } catch (InterruptedException | BrokenBarrierException e) {
             throw new RuntimeException("Synchronization error happened.", e);
         }
     }
 
-    public void test() {
+    public void syncAndTest() {
         try {
             barrier.await();
             // wait until monitor is locked by a ::run method
             barrier.await();
         } catch (InterruptedException | BrokenBarrierException e) {
             throw new RuntimeException("Synchronization error happened.", e);
         }
+        test();
+    }
+
+    public void test() {
         synchronized(monitor) {
             BusyLock.field++;
         }
     }
 

@@ -128,9 +132,9 @@
             AbortProvoker.inflateMonitor(busyLock.monitor);
         }
 
         Thread t = new Thread(busyLock);
         t.start();
-        busyLock.test();
+        busyLock.syncAndTest();
         t.join();
     }
 }
< prev index next >