Use boost asio executor_work_guard to fix build

This commit is contained in:
emeric
2025-02-10 17:09:52 +01:00
parent c9fb398196
commit 6494d17f99
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ namespace lms::core
{
IOContextRunner::IOContextRunner(boost::asio::io_context& ioContext, std::size_t threadCount, std::string_view name)
: _ioContext{ ioContext }
, _work{ ioContext }
, _work{ boost::asio::make_work_guard(ioContext) }
{
LMS_LOG(UTILS, INFO, "Starting IO context with " << threadCount << " threads...");
@@ -19,9 +19,9 @@
#pragma once
#include <optional>
#include <thread>
#include <boost/asio/executor_work_guard.hpp>
#include <boost/asio/io_context.hpp>
namespace lms::core
@@ -39,7 +39,7 @@ namespace lms::core
private:
boost::asio::io_context& _ioContext;
std::optional<boost::asio::io_context::work> _work;
boost::asio::executor_work_guard<boost::asio::io_context::executor_type> _work;
std::vector<std::thread> _threads;
};
} // namespace lms::core