Rename preventGc to keepAlive

This commit is contained in:
Alexander A. Klimov 2019-03-11 10:12:05 +01:00
parent 915525dbcd
commit 5b2c1f023d
2 changed files with 12 additions and 12 deletions

View File

@ -51,19 +51,19 @@ void HttpServerConnection::Start()
{ {
namespace asio = boost::asio; namespace asio = boost::asio;
HttpServerConnection::Ptr preventGc (this); HttpServerConnection::Ptr keepAlive (this);
asio::spawn(m_IoStrand, [this, preventGc](asio::yield_context yc) { ProcessMessages(yc); }); asio::spawn(m_IoStrand, [this, keepAlive](asio::yield_context yc) { ProcessMessages(yc); });
asio::spawn(m_IoStrand, [this, preventGc](asio::yield_context yc) { CheckLiveness(yc); }); asio::spawn(m_IoStrand, [this, keepAlive](asio::yield_context yc) { CheckLiveness(yc); });
} }
void HttpServerConnection::Disconnect() void HttpServerConnection::Disconnect()
{ {
namespace asio = boost::asio; namespace asio = boost::asio;
HttpServerConnection::Ptr preventGc (this); HttpServerConnection::Ptr keepAlive (this);
asio::spawn(m_IoStrand, [this, preventGc](asio::yield_context yc) { asio::spawn(m_IoStrand, [this, keepAlive](asio::yield_context yc) {
if (!m_ShuttingDown) { if (!m_ShuttingDown) {
m_ShuttingDown = true; m_ShuttingDown = true;

View File

@ -41,12 +41,12 @@ void JsonRpcConnection::Start()
{ {
namespace asio = boost::asio; namespace asio = boost::asio;
JsonRpcConnection::Ptr preventGc (this); JsonRpcConnection::Ptr keepAlive (this);
asio::spawn(m_IoStrand, [this, preventGc](asio::yield_context yc) { HandleIncomingMessages(yc); }); asio::spawn(m_IoStrand, [this, keepAlive](asio::yield_context yc) { HandleIncomingMessages(yc); });
asio::spawn(m_IoStrand, [this, preventGc](asio::yield_context yc) { WriteOutgoingMessages(yc); }); asio::spawn(m_IoStrand, [this, keepAlive](asio::yield_context yc) { WriteOutgoingMessages(yc); });
asio::spawn(m_IoStrand, [this, preventGc](asio::yield_context yc) { HandleAndWriteHeartbeats(yc); }); asio::spawn(m_IoStrand, [this, keepAlive](asio::yield_context yc) { HandleAndWriteHeartbeats(yc); });
asio::spawn(m_IoStrand, [this, preventGc](asio::yield_context yc) { CheckLiveness(yc); }); asio::spawn(m_IoStrand, [this, keepAlive](asio::yield_context yc) { CheckLiveness(yc); });
} }
void JsonRpcConnection::HandleIncomingMessages(boost::asio::yield_context yc) void JsonRpcConnection::HandleIncomingMessages(boost::asio::yield_context yc)
@ -182,9 +182,9 @@ void JsonRpcConnection::Disconnect()
{ {
namespace asio = boost::asio; namespace asio = boost::asio;
JsonRpcConnection::Ptr preventGc (this); JsonRpcConnection::Ptr keepAlive (this);
asio::spawn(m_IoStrand, [this, preventGc](asio::yield_context yc) { asio::spawn(m_IoStrand, [this, keepAlive](asio::yield_context yc) {
if (!m_ShuttingDown) { if (!m_ShuttingDown) {
m_ShuttingDown = true; m_ShuttingDown = true;