diff --git a/include/async_mqtt/broker/endpoint_variant.hpp b/include/async_mqtt/broker/endpoint_variant.hpp index 5da588b48..06486ec87 100644 --- a/include/async_mqtt/broker/endpoint_variant.hpp +++ b/include/async_mqtt/broker/endpoint_variant.hpp @@ -113,10 +113,10 @@ class epsp_wrap { ); } - bool running_in_this_thread() const { + bool in_strand() const { return visit( [&](auto& ep) -> bool { - return ep.strand().running_in_this_thread(); + return ep.in_strand(); } ); } @@ -137,14 +137,6 @@ class epsp_wrap { ); } - bool in_strand() const { - return visit( - [&](auto& ep) { - return ep.in_strand(); - } - ); - } - // async functions template diff --git a/include/async_mqtt/broker/offline_message.hpp b/include/async_mqtt/broker/offline_message.hpp index 33f04494d..bbd0e3ab6 100644 --- a/include/async_mqtt/broker/offline_message.hpp +++ b/include/async_mqtt/broker/offline_message.hpp @@ -66,7 +66,7 @@ class offline_message { template bool send(Epsp epsp, protocol_version ver) { - BOOST_ASSERT(epsp.running_in_this_thread()); + BOOST_ASSERT(epsp.in_strand()); auto publish = [&] (packet_id_t pid) { switch (ver) {