take care of another scenario where a thread can leak
This commit is contained in:
@ -464,7 +464,12 @@ class TCPConnection implements I2NPMessageReader.I2NPMessageEventListener {
|
|||||||
|
|
||||||
private OutNetMessage getNext() {
|
private OutNetMessage getNext() {
|
||||||
OutNetMessage msg = null;
|
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) {
|
synchronized (_toBeSent) {
|
||||||
if (_toBeSent.size() <= 0) {
|
if (_toBeSent.size() <= 0) {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user