servercontext wait for transport worker threads to finish

doing this through Transport::close()
causes deadlock in client code due to locking.
So make this an extra step.
This commit is contained in:
Michael Davidsaver
2017-06-26 14:16:41 +02:00
parent 3dca3dc38f
commit 0c02625aa5
4 changed files with 13 additions and 3 deletions

View File

@@ -1001,9 +1001,7 @@ bool AbstractCodec::directDeserialize(ByteBuffer *existingBuffer, char* deserial
BlockingTCPTransportCodec::~BlockingTCPTransportCodec()
{
assert(!_isOpen.get());
_sendThread.exitWait();
_readThread.exitWait();
waitJoin();
}
void BlockingTCPTransportCodec::readPollOne() {
@@ -1035,6 +1033,13 @@ void BlockingTCPTransportCodec::close() {
}
}
void BlockingTCPTransportCodec::waitJoin()
{
assert(!_isOpen.get());
_sendThread.exitWait();
_readThread.exitWait();
}
void BlockingTCPTransportCodec::internalClose(bool /*force*/)
{
this->internalDestroy();