diff options
-rw-r--r-- | src/common/Asio/Strand.h | 6 | ||||
-rw-r--r-- | src/common/Logging/Log.cpp | 2 | ||||
-rw-r--r-- | src/common/Metric/Metric.cpp | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/common/Asio/Strand.h b/src/common/Asio/Strand.h index 5beef144c60..942ddf55cd4 100644 --- a/src/common/Asio/Strand.h +++ b/src/common/Asio/Strand.h @@ -35,7 +35,11 @@ namespace Trinity Strand(IoContext& ioContext) : boost::asio::io_context::strand(ioContext) { } }; - using boost::asio::bind_executor; + template<typename T> + inline decltype(auto) post(boost::asio::io_context::strand& strand, T&& t) + { + return boost::asio::post(strand, std::forward<T>(t)); + } } } diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp index c61ebb2bf85..75ea4fae380 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -238,7 +238,7 @@ void Log::write(std::unique_ptr<LogMessage> msg) const if (_ioContext) { std::shared_ptr<LogOperation> logOperation = std::make_shared<LogOperation>(logger, std::move(msg)); - Trinity::Asio::post(*_ioContext, Trinity::Asio::bind_executor(*_strand, [logOperation]() { logOperation->call(); })); + Trinity::Asio::post(*_strand, [logOperation]() { logOperation->call(); }); } else logger->write(msg.get()); diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp index 7cd4f56fba5..0dc8e11ae80 100644 --- a/src/common/Metric/Metric.cpp +++ b/src/common/Metric/Metric.cpp @@ -18,8 +18,8 @@ #include "Metric.h" #include "Config.h" #include "DeadlineTimer.h" +#include "IoContext.h" #include "Log.h" -#include "Strand.h" #include "Util.h" #include <boost/algorithm/string/replace.hpp> #include <boost/asio/ip/tcp.hpp> |