Enlarge critical section to cover processNextTransaction() 79/36779/1
authorRobert Varga <rovarga@cisco.com>
Thu, 24 Mar 2016 18:59:49 +0000 (19:59 +0100)
committerTom Pantelis <tpanteli@brocade.com>
Sun, 27 Mar 2016 12:16:52 +0000 (12:16 +0000)
commit2653419eea6056777757cac04010326db44225db
tree4925767fffa6a8df019a95fb41ca385c33485918
parent3d2d08de83c8ae36338188de15c1a426b7015478
Enlarge critical section to cover processNextTransaction()

As it turns out the critical section is not sufficient to cover the case
when the user thread performs a submit/allocate/submit in the time window
between us releasing the in-flight transaction and taking the lock: we would
have to re-check inflightTx after taking the lock.

Since we are going to take the lock anyway, reverse the order of operations
by making processNextTransaction() synchronized, which means the user
thread will not be able to submit the transaction even when it observes
inflightTx as null outside the lock.

Change-Id: I688ceb5e8aae28f5e582b64e6bbaa64c9699c7f5
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 30d98c1da2a32f719302668f8deb6ef4f371749c)
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java