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

Skip to content
Snippets Groups Projects
Commit e57c010e authored by jrandom's avatar jrandom Committed by zzz
Browse files

reduced context switches by removing the timeout val that was redundant

parent 4dfcf1c1
No related branches found
No related tags found
No related merge requests found
...@@ -701,6 +701,9 @@ public class TCPTransport extends TransportImpl { ...@@ -701,6 +701,9 @@ public class TCPTransport extends TransportImpl {
PendingMessages rv = null; PendingMessages rv = null;
while (true) { while (true) {
synchronized (_msgs) { synchronized (_msgs) {
if (_msgs.size() <= 0) {
try { _msgs.wait(); } catch (InterruptedException ie) {}
}
if (_msgs.size() > 0) { if (_msgs.size() > 0) {
for (Iterator iter = _msgs.keySet().iterator(); iter.hasNext(); ) { for (Iterator iter = _msgs.keySet().iterator(); iter.hasNext(); ) {
Object key = iter.next(); Object key = iter.next();
...@@ -717,7 +720,6 @@ public class TCPTransport extends TransportImpl { ...@@ -717,7 +720,6 @@ public class TCPTransport extends TransportImpl {
} }
} }
} }
try { _msgs.wait(1000); } catch (InterruptedException ie) {}
} }
} }
......
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