mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Wait for reader/writer thread termination at the end of shutdown()
This synchronizes the place with what the master branch currently does.
This commit is contained in:
parent
3ded023629
commit
7059b60672
1 changed files with 4 additions and 4 deletions
|
@ -561,6 +561,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
writer = null;
|
writer = null;
|
||||||
|
|
||||||
initState();
|
initState();
|
||||||
|
|
||||||
|
// Wait for reader and writer threads to be terminated.
|
||||||
|
readerWriterSemaphore.acquireUninterruptibly(2);
|
||||||
|
readerWriterSemaphore.release(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -978,10 +982,6 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
// Note that a connection listener of XMPPTCPConnection will drop the SM state in
|
// Note that a connection listener of XMPPTCPConnection will drop the SM state in
|
||||||
// case the Exception is a StreamErrorException.
|
// case the Exception is a StreamErrorException.
|
||||||
instantShutdown();
|
instantShutdown();
|
||||||
|
|
||||||
// Wait for reader and writer threads to be terminated.
|
|
||||||
readerWriterSemaphore.acquireUninterruptibly(2);
|
|
||||||
readerWriterSemaphore.release(2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Async.go(new Runnable() {
|
Async.go(new Runnable() {
|
||||||
|
|
Loading…
Reference in a new issue