X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FThreePhaseCommitCohortProxy.java;h=8f6271605727abba421dafd8bb9dee3a070bdd0c;hb=04ce3cfa566f7667800abb376d533f41246ff909;hp=17017b9b668ea699d1dab0ecfa7deac2448c84b4;hpb=925cb4a228d0fda99c7bfeb432eb25285a223887;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java index 17017b9b66..8f62716057 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java @@ -87,11 +87,12 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< } final AtomicInteger completed = new AtomicInteger(cohorts.size()); + final Object lock = new Object(); for (final CohortInfo info: cohorts) { info.getActorFuture().onComplete(new OnComplete() { @Override public void onComplete(Throwable failure, ActorSelection actor) { - synchronized (completed) { + synchronized (lock) { boolean done = completed.decrementAndGet() == 0; if (failure != null) { LOG.debug("Tx {}: a cohort Future failed", transactionId, failure);