diff --git a/src/libs/core/impl/IOContextRunner.cpp b/src/libs/core/impl/IOContextRunner.cpp index 465cf0fe..7dbf435c 100644 --- a/src/libs/core/impl/IOContextRunner.cpp +++ b/src/libs/core/impl/IOContextRunner.cpp @@ -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..."); diff --git a/src/libs/core/include/core/IOContextRunner.hpp b/src/libs/core/include/core/IOContextRunner.hpp index 56b1f881..57a8f0a7 100644 --- a/src/libs/core/include/core/IOContextRunner.hpp +++ b/src/libs/core/include/core/IOContextRunner.hpp @@ -19,9 +19,9 @@ #pragma once -#include #include +#include #include namespace lms::core @@ -39,7 +39,7 @@ namespace lms::core private: boost::asio::io_context& _ioContext; - std::optional _work; + boost::asio::executor_work_guard _work; std::vector _threads; }; } // namespace lms::core \ No newline at end of file