Log if not all reader/writer threads where terminated

This commit is contained in:
Florian Schmaus 2019-02-08 13:08:51 +01:00
parent 62cba0d96f
commit 5c8e830157
1 changed files with 8 additions and 0 deletions

View File

@ -652,6 +652,14 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
packetReader = new PacketReader();
}
int availableReaderWriterSemaphorePermits = readerWriterSemaphore.availablePermits();
if (availableReaderWriterSemaphorePermits < 2) {
Object[] logObjects = new Object[] {
this,
availableReaderWriterSemaphorePermits,
};
LOGGER.log(Level.FINE, "Not every reader/writer threads where terminated on connection re-initializtion of {0}. Available permits {1}", logObjects);
}
readerWriterSemaphore.acquire(2);
// Start the writer thread. This will open an XMPP stream to the server
packetWriter.init();