mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-11-23 15:32:11 +00:00
take care of another scenario where a thread can leak
This commit is contained in:
1 parent
7e7f97d72a
commit
fab3c0df3e
1 file changed
+6
-1
@@ -464,7 +464,12 @@ class TCPConnection implements I2NPMessageReader.I2NPMessageEventListener {
|
||||
|
||||
private OutNetMessage getNext() {
|
||||
OutNetMessage msg = null;
|
||||
while ( (msg == null) && (_running) ) {
|
||||
// _running is kept seperate from _closed, since _running refers
|
||||
// to the ConnectionRunner, while _closed refers to the TCPConnection
|
||||
// (in case we want to pause running, etc). they both need to be
|
||||
// checked here, since the connection may be closed before this
|
||||
// thread even gets started up
|
||||
while ( (msg == null) && (_running) && (!_closed) ) {
|
||||
synchronized (_toBeSent) {
|
||||
if (_toBeSent.size() <= 0) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user