From 98098984705fb4edd9e0b113e7d1acb97698430a Mon Sep 17 00:00:00 2001 From: Mike Jensen Date: Fri, 3 Jan 2014 15:27:11 -0700 Subject: [PATCH] Moved the waitTillReady to before the doOperation call in order to have the threads synchronized. --- test/AtomicIntegerTest.java | 2 +- test/AtomicLongTest.java | 2 +- test/AtomicReferenceTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/AtomicIntegerTest.java b/test/AtomicIntegerTest.java index 72da50d446..1736fe11c2 100644 --- a/test/AtomicIntegerTest.java +++ b/test/AtomicIntegerTest.java @@ -14,8 +14,8 @@ public class AtomicIntegerTest { @Override public void run() { try { - doOperation(); waitTillReady(); + doOperation(); } finally { synchronized (threadDoneCount) { threadDoneCount.incrementAndGet(); diff --git a/test/AtomicLongTest.java b/test/AtomicLongTest.java index cb441f4295..db6bd618c0 100644 --- a/test/AtomicLongTest.java +++ b/test/AtomicLongTest.java @@ -14,8 +14,8 @@ public class AtomicLongTest { @Override public void run() { try { - doOperation(); waitTillReady(); + doOperation(); } finally { synchronized (threadDoneCount) { threadDoneCount.incrementAndGet(); diff --git a/test/AtomicReferenceTest.java b/test/AtomicReferenceTest.java index 8ed2b561fd..69d16d850a 100644 --- a/test/AtomicReferenceTest.java +++ b/test/AtomicReferenceTest.java @@ -14,8 +14,8 @@ public class AtomicReferenceTest { @Override public void run() { try { - doOperation(); waitTillReady(); + doOperation(); } finally { synchronized (threadDoneCount) { threadDoneCount.incrementAndGet();