mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 02:27:58 +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;
|
||||
|
||||
initState();
|
||||
|
||||
// Wait for reader and writer threads to be terminated.
|
||||
readerWriterSemaphore.acquireUninterruptibly(2);
|
||||
readerWriterSemaphore.release(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -978,10 +982,6 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
// Note that a connection listener of XMPPTCPConnection will drop the SM state in
|
||||
// case the Exception is a StreamErrorException.
|
||||
instantShutdown();
|
||||
|
||||
// Wait for reader and writer threads to be terminated.
|
||||
readerWriterSemaphore.acquireUninterruptibly(2);
|
||||
readerWriterSemaphore.release(2);
|
||||
}
|
||||
|
||||
Async.go(new Runnable() {
|
||||
|
|
Loading…
Reference in a new issue