BUG-509: Fix thread safety of listener registration 72/5972/2
authorRobert Varga <rovarga@cisco.com>
Tue, 8 Apr 2014 16:07:32 +0000 (18:07 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 9 Apr 2014 03:35:49 +0000 (05:35 +0200)
commita55afc7157bfc72ddd6d639c3842768763933a57
tree5647b5347495281b3b08c32a2a59872f74d9b272
parentdb19853c7b8a5396cc0b9474bb197f5a678f9e64
BUG-509: Fix thread safety of listener registration

This commit fixes the race condition where a listener is registered
after preCommit() and before commit(). This is done by moving the
collection into the commit() where it is protected by the
commit/listener synchronized block.

The unregistration safety is handled by wrapping the returned
registration and invoking the equivalent synchronized block.

Change-Id: Ie9abc81b2a773418b34c3051f7665b0dcf047f76
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataChangeEventResolver.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/ListenerRegistrationNode.java