BUG-509: Fix thread safety of DOMDataBrokerImpl.ready()
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / DOMDataBrokerImpl.java
index fc87a9110576054eb75571167d01f60c1c95c98e..64a5606e3fb613a04a70a76cff65a83759cdd589 100644 (file)
@@ -190,7 +190,7 @@ public class DOMDataBrokerImpl implements DOMDataBroker, AutoCloseable {
             this.broker = broker;
         }
 
-        public Iterable<DOMStoreThreePhaseCommitCohort> ready() {
+        public synchronized Iterable<DOMStoreThreePhaseCommitCohort> ready() {
             checkState(cohorts == null, "Transaction was already marked as ready.");
             ImmutableList.Builder<DOMStoreThreePhaseCommitCohort> cohortsBuilder = ImmutableList.builder();
             for (DOMStoreWriteTransaction subTx : getSubtransactions()) {