mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 22:58:32 +01:00
Fix race between connectionClosed() and ConnectionHandler()
This commit is contained in:
parent
4dc3392719
commit
5f5700bbb0
1 changed files with 2 additions and 2 deletions
|
@ -92,11 +92,11 @@ class ConnectionHandler implements MessageWriteTarget {
|
|||
try {
|
||||
alreadyClosed = closeCalled;
|
||||
this.connectedHandlers = connectedHandlers;
|
||||
if (!alreadyClosed)
|
||||
checkState(connectedHandlers.add(this));
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
if (!alreadyClosed)
|
||||
checkState(connectedHandlers.add(this));
|
||||
}
|
||||
|
||||
@GuardedBy("lock")
|
||||
|
|
Loading…
Add table
Reference in a new issue