codec: less force-ful shutdown

eliminate unused 'force' argument.
This commit is contained in:
Michael Davidsaver
2018-04-02 10:46:57 -07:00
parent da85d39c0c
commit 434a43dfe1
2 changed files with 16 additions and 20 deletions

View File

@@ -1040,14 +1040,14 @@ void BlockingTCPTransportCodec::close() {
// wakeup processSendQueue
// clean resources (close socket)
internalClose(true);
internalClose();
// Break sender from queue wait
BreakTransport::shared_pointer B(new BreakTransport);
enqueueSendRequest(B);
// post close
internalPostClose(true);
internalPostClose();
}
}
@@ -1058,7 +1058,7 @@ void BlockingTCPTransportCodec::waitJoin()
_readThread.exitWait();
}
void BlockingTCPTransportCodec::internalClose(bool /*force*/)
void BlockingTCPTransportCodec::internalClose()
{
{
@@ -1585,9 +1585,9 @@ void BlockingServerTCPTransportCodec::destroyAllChannels() {
it->second->destroy();
}
void BlockingServerTCPTransportCodec::internalClose(bool force) {
void BlockingServerTCPTransportCodec::internalClose() {
Transport::shared_pointer thisSharedPtr = shared_from_this();
BlockingTCPTransportCodec::internalClose(force);
BlockingTCPTransportCodec::internalClose();
destroyAllChannels();
}
@@ -1771,15 +1771,15 @@ bool BlockingClientTCPTransportCodec::acquire(ClientChannelImpl::shared_pointer
}
// _mutex is held when this method is called
void BlockingClientTCPTransportCodec::internalClose(bool forced) {
BlockingTCPTransportCodec::internalClose(forced);
void BlockingClientTCPTransportCodec::internalClose() {
BlockingTCPTransportCodec::internalClose();
TimerCallbackPtr tcb = std::tr1::dynamic_pointer_cast<TimerCallback>(shared_from_this());
_context->getTimer()->cancel(tcb);
}
void BlockingClientTCPTransportCodec::internalPostClose(bool forced) {
BlockingTCPTransportCodec::internalPostClose(forced);
void BlockingClientTCPTransportCodec::internalPostClose() {
BlockingTCPTransportCodec::internalPostClose();
// _owners cannot change when transport is closed
closedNotifyClients();

View File

@@ -449,18 +449,14 @@ protected:
virtual void sendBufferFull(int tries) OVERRIDE FINAL;
/**
* Called to any resources just before closing transport
* @param[in] force flag indicating if forced (e.g. forced
* disconnect) is required
* Called from close(). prior to signaling worker shutdown.
*/
virtual void internalClose(bool force);
virtual void internalClose();
/**
* Called to any resources just after closing transport and without any locks held on transport
* @param[in] force flag indicating if forced (e.g. forced
* disconnect) is required
* Called from close(). after signaling worker shutdown.
*/
virtual void internalPostClose(bool force) {}
virtual void internalPostClose() {}
private:
AtomicValue<bool> _isOpen;
@@ -586,7 +582,7 @@ public:
protected:
void destroyAllChannels();
virtual void internalClose(bool force) OVERRIDE FINAL;
virtual void internalClose() OVERRIDE FINAL;
private:
@@ -686,8 +682,8 @@ public:
protected:
virtual void internalClose(bool force) OVERRIDE FINAL;
virtual void internalPostClose(bool force) OVERRIDE FINAL;
virtual void internalClose() OVERRIDE FINAL;
virtual void internalPostClose() OVERRIDE FINAL;
private: