Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
KEP-1360: fix daemon code being executed by asio system threads
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelsavannah committed Apr 24, 2019
1 parent d6e79e5 commit 4144865
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/boost_asio_beast.hpp
Expand Up @@ -300,7 +300,7 @@ namespace bzn::asio

void post(bzn::asio::task func) override
{
boost::asio::post(func);
boost::asio::post(this->io_context, func);
}

boost::asio::io_context::count_type run() override
Expand Down
8 changes: 4 additions & 4 deletions node/test/node_test_common.hpp
Expand Up @@ -63,7 +63,7 @@ namespace bzn
EXPECT_CALL(*(this->io_context), post(_)).WillRepeatedly(Invoke(
[&](auto func)
{
this->real_io_context->post(func);
boost::asio::post(func);
}));

EXPECT_CALL(*(this->io_context), make_unique_steady_timer()).WillRepeatedly(Invoke(
Expand Down Expand Up @@ -98,7 +98,7 @@ namespace bzn
EXPECT_CALL(*mock_socket, async_connect(_, _)).Times(AtMost(1)).WillOnce(Invoke(
[&](auto, auto handler)
{
this->real_io_context->post(std::bind(handler,
boost::asio::post(std::bind(handler,
this->tcp_connect_works ? boost::system::error_code{} : boost::asio::error::connection_refused));
}));

Expand Down Expand Up @@ -163,7 +163,7 @@ namespace bzn
EXPECT_CALL(*wss, async_handshake(_, _, _)).Times(AtMost(1)).WillRepeatedly(Invoke(
[&](auto, auto, auto handler)
{
this->real_io_context->post(std::bind(handler, boost::system::error_code{}));
boost::asio::post(std::bind(handler, boost::system::error_code{}));
}));

EXPECT_CALL(*wss, is_open()).WillRepeatedly(Invoke(
Expand All @@ -177,7 +177,7 @@ namespace bzn
[&, id](auto /*reason*/, auto handler)
{
this->ws_closed.insert_or_assign(id, true);
this->real_io_context->post(std::bind(handler, boost::system::error_code{}));
boost::asio::post(std::bind(handler, boost::system::error_code{}));
}));

EXPECT_CALL(*wss, binary(_)).Times(AnyNumber());
Expand Down

0 comments on commit 4144865

Please sign in to comment.