< 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,92 **** } catch (InterruptedException | BrokenBarrierException e) { throw new RuntimeException("Synchronization error happened.", e); } } ! public void test() { 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); } synchronized(monitor) { BusyLock.field++; } } --- 75,96 ---- } catch (InterruptedException | BrokenBarrierException e) { throw new RuntimeException("Synchronization error happened.", e); } } ! 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,136 **** AbortProvoker.inflateMonitor(busyLock.monitor); } Thread t = new Thread(busyLock); t.start(); ! busyLock.test(); t.join(); } } --- 132,140 ---- AbortProvoker.inflateMonitor(busyLock.monitor); } Thread t = new Thread(busyLock); t.start(); ! busyLock.syncAndTest(); t.join(); } }
< prev index next >