diff test/compiler/testlibrary/rtm/MemoryConflictProvoker.java @ 22994:9041e030d11f

8050486: compiler/rtm/ tests fail due to monitor deflation at safepoint synchronization Reviewed-by: kvn, iignatyev
author bmoloden
date Thu, 30 Apr 2015 12:06:39 -0700
parents 665bbe93823f
children
line wrap: on
line diff
--- a/test/compiler/testlibrary/rtm/MemoryConflictProvoker.java	Thu Apr 30 11:47:53 2015 -0700
+++ b/test/compiler/testlibrary/rtm/MemoryConflictProvoker.java	Thu Apr 30 12:06:39 2015 -0700
@@ -69,11 +69,6 @@
      * Accesses and modifies memory region from within the transaction.
      */
     public void transactionalRegion() {
-        try {
-            barrier.await();
-        } catch (InterruptedException | BrokenBarrierException e) {
-            throw new RuntimeException(e);
-        }
         for (int i = 0; i < MemoryConflictProvoker.INNER_ITERATIONS; i++) {
             synchronized(monitor) {
                 MemoryConflictProvoker.field--;
@@ -86,6 +81,11 @@
         try {
             Thread t = new Thread(conflictingThread);
             t.start();
+            try {
+                barrier.await();
+            } catch (InterruptedException | BrokenBarrierException e) {
+                throw new RuntimeException(e);
+            }
             transactionalRegion();
             t.join();
         } catch (Exception e) {