Use boost asio executor_work_guard to fix build
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user