I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 832d66bf authored by zzz's avatar zzz
Browse files

NTCP: Reduce lock contention (ticket #697)

parent c8a46dac
No related branches found
No related tags found
No related merge requests found
...@@ -64,8 +64,9 @@ class Reader { ...@@ -64,8 +64,9 @@ class Reader {
already = true; already = true;
} else { } else {
_pendingConnections.add(con); _pendingConnections.add(con);
// only notify here if added?
} }
_pendingConnections.notifyAll(); _pendingConnections.notify();
} }
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("wantsRead: " + con + " already live? " + already); _log.debug("wantsRead: " + con + " already live? " + already);
...@@ -75,7 +76,8 @@ class Reader { ...@@ -75,7 +76,8 @@ class Reader {
synchronized (_pendingConnections) { synchronized (_pendingConnections) {
_readAfterLive.remove(con); _readAfterLive.remove(con);
_pendingConnections.remove(con); _pendingConnections.remove(con);
_pendingConnections.notifyAll(); // necessary?
_pendingConnections.notify();
} }
} }
......
...@@ -62,8 +62,9 @@ class Writer { ...@@ -62,8 +62,9 @@ class Writer {
already = true; already = true;
} else { } else {
pending = _pendingConnections.add(con); pending = _pendingConnections.add(con);
// only notify here if added?
} }
_pendingConnections.notifyAll(); _pendingConnections.notify();
} }
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("wantsWrite: " + con + " already live? " + already + " added to pending? " + pending + ": " + source); _log.debug("wantsWrite: " + con + " already live? " + already + " added to pending? " + pending + ": " + source);
...@@ -73,7 +74,8 @@ class Writer { ...@@ -73,7 +74,8 @@ class Writer {
synchronized (_pendingConnections) { synchronized (_pendingConnections) {
_writeAfterLive.remove(con); _writeAfterLive.remove(con);
_pendingConnections.remove(con); _pendingConnections.remove(con);
_pendingConnections.notifyAll(); // necessary?
_pendingConnections.notify();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment