Set 'running' to true prior starting the reader/writer threads

To ensure the thread starting the reader/writer threads sees them
running and eventually waits until the 'running' boolean is reset to
'false' upon connection termination.
This commit is contained in:
Florian Schmaus 2020-06-17 21:55:24 +02:00
parent c384849532
commit 63f133e68b
1 changed files with 2 additions and 2 deletions

View File

@ -912,11 +912,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
void init() {
done = false;
running = true;
Async.go(new Runnable() {
@Override
public void run() {
LOGGER.finer(threadName + " start");
running = true;
try {
parsePackets();
} finally {
@ -1184,11 +1184,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
}
queue.start();
running = true;
Async.go(new Runnable() {
@Override
public void run() {
LOGGER.finer(threadName + " start");
running = true;
try {
writePackets();
} finally {