forked from I2P_Developers/i2p.i2p
NTCP: Reduce lock contention (ticket #697)
This commit is contained in:
@ -64,8 +64,9 @@ class Reader {
|
||||
already = true;
|
||||
} else {
|
||||
_pendingConnections.add(con);
|
||||
// only notify here if added?
|
||||
}
|
||||
_pendingConnections.notifyAll();
|
||||
_pendingConnections.notify();
|
||||
}
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("wantsRead: " + con + " already live? " + already);
|
||||
@ -75,7 +76,8 @@ class Reader {
|
||||
synchronized (_pendingConnections) {
|
||||
_readAfterLive.remove(con);
|
||||
_pendingConnections.remove(con);
|
||||
_pendingConnections.notifyAll();
|
||||
// necessary?
|
||||
_pendingConnections.notify();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,8 +62,9 @@ class Writer {
|
||||
already = true;
|
||||
} else {
|
||||
pending = _pendingConnections.add(con);
|
||||
// only notify here if added?
|
||||
}
|
||||
_pendingConnections.notifyAll();
|
||||
_pendingConnections.notify();
|
||||
}
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("wantsWrite: " + con + " already live? " + already + " added to pending? " + pending + ": " + source);
|
||||
@ -73,7 +74,8 @@ class Writer {
|
||||
synchronized (_pendingConnections) {
|
||||
_writeAfterLive.remove(con);
|
||||
_pendingConnections.remove(con);
|
||||
_pendingConnections.notifyAll();
|
||||
// necessary?
|
||||
_pendingConnections.notify();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user