Moved the waitTillReady to before the doOperation call in order to have the threads synchronized.

This commit is contained in:
Mike Jensen 2014-01-03 15:27:11 -07:00
parent 3fdf29a670
commit 9809898470
3 changed files with 3 additions and 3 deletions

View File

@ -14,8 +14,8 @@ public class AtomicIntegerTest {
@Override
public void run() {
try {
doOperation();
waitTillReady();
doOperation();
} finally {
synchronized (threadDoneCount) {
threadDoneCount.incrementAndGet();

View File

@ -14,8 +14,8 @@ public class AtomicLongTest {
@Override
public void run() {
try {
doOperation();
waitTillReady();
doOperation();
} finally {
synchronized (threadDoneCount) {
threadDoneCount.incrementAndGet();

View File

@ -14,8 +14,8 @@ public class AtomicReferenceTest {
@Override
public void run() {
try {
doOperation();
waitTillReady();
doOperation();
} finally {
synchronized (threadDoneCount) {
threadDoneCount.incrementAndGet();