Fix a potential deadlock in BGPSession 40/14340/1
authorRobert Varga <rovarga@cisco.com>
Wed, 21 Jan 2015 15:17:49 +0000 (16:17 +0100)
committerRobert Varga <nite@hq.sk>
Wed, 21 Jan 2015 15:22:08 +0000 (15:22 +0000)
commitb386ec093c89884a3eaad2984906870fe6022875
treee6c551fb1204a4655525e60574d4e1783f47b961
parentd2460a23df8a968394895d2eb1206288c80c9953
Fix a potential deadlock in BGPSession

In a two-session scenario, it is possible to arrive at a ABBA deadlock,
where we acquire locks:

Thread 1      Thread 2
--------      --------
Session A     Session B

RIB
              RIB <-- blocks waiting for Thread 1

Session B <-- blocks waiting for Thread 2

The lock is being held only for scheduling a task on Thread 2, which a
thread-safe operation, so we can simply remove the need to take the lock
in Thread 1.

Change-Id: I4e55d3228a48790b2f19eef12ce1b54fd57955a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java