Enlarge critical section to cover processNextTransaction() 49/36749/2
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:23 +0000 (12:16 +0000)
commit30d98c1da2a32f719302668f8deb6ef4f371749c
tree7bf342e6c7cd64213245ef9359d917bf15e1527b
parentf86f7e8c204fb19615c45e669a764c623576e1a3
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>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java