1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 10:37:59 +01:00

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

View file

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