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>
return this.channel != null && this.channel.isWritable();
}
- synchronized void schedule(final Runnable task) {
+ void schedule(final Runnable task) {
Preconditions.checkState(this.channel != null);
this.channel.eventLoop().submit(task);
}