From 434a43dfe14b005ef7afeac8eef4a096208a9178 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 2 Apr 2018 10:46:57 -0700 Subject: [PATCH] codec: less force-ful shutdown eliminate unused 'force' argument. --- src/remote/codec.cpp | 18 +++++++++--------- src/remote/pv/codec.h | 18 +++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/remote/codec.cpp b/src/remote/codec.cpp index f50ffbc..3588af9 100644 --- a/src/remote/codec.cpp +++ b/src/remote/codec.cpp @@ -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(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(); diff --git a/src/remote/pv/codec.h b/src/remote/pv/codec.h index 92c5017..f4dffa8 100644 --- a/src/remote/pv/codec.h +++ b/src/remote/pv/codec.h @@ -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 _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: