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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user