Boost.ASIO: upgrade io_service=>io_context, finally

This commit is contained in:
2026-05-30 11:59:42 -04:00
parent f100764bd8
commit 4266af545a
26 changed files with 91 additions and 90 deletions
+12 -12
View File
@@ -13,73 +13,73 @@
namespace smo {
namespace mrntt {
boost::asio::io_service &MrnttThreadTag::io_service() noexcept
boost::asio::io_context &MrnttThreadTag::io_context() noexcept
{
return thread->getIoService();
return thread->getIoContext();
}
} // namespace mrntt
namespace body {
boost::asio::io_service &BodyThreadTag::io_service()
boost::asio::io_context &BodyThreadTag::io_context()
{
if (!mind::globalMind) {
throw std::runtime_error(
"BodyThreadTag: globalMind not initialized");
}
return mind::globalMind->body.thread->getIoService();
return mind::globalMind->body.thread->getIoContext();
}
} // namespace body
namespace director {
boost::asio::io_service &DirectorThreadTag::io_service()
boost::asio::io_context &DirectorThreadTag::io_context()
{
if (!mind::globalMind) {
throw std::runtime_error(
"DirectorThreadTag: globalMind not initialized");
}
return mind::globalMind->director.thread->getIoService();
return mind::globalMind->director.thread->getIoContext();
}
} // namespace director
namespace simulator {
boost::asio::io_service &SimulatorThreadTag::io_service()
boost::asio::io_context &SimulatorThreadTag::io_context()
{
if (!mind::globalMind) {
throw std::runtime_error(
"SimulatorThreadTag: globalMind not initialized");
}
return mind::globalMind->canvas.thread->getIoService();
return mind::globalMind->canvas.thread->getIoContext();
}
} // namespace simulator
boost::asio::io_service &SubconsciousThreadTag::io_service()
boost::asio::io_context &SubconsciousThreadTag::io_context()
{
if (!mind::globalMind) {
throw std::runtime_error(
"SubconsciousThreadTag: globalMind not initialized");
}
return mind::globalMind->subconscious.thread->getIoService();
return mind::globalMind->subconscious.thread->getIoContext();
}
boost::asio::io_service &WorldThreadTag::io_service()
boost::asio::io_context &WorldThreadTag::io_context()
{
if (!mind::globalMind) {
throw std::runtime_error(
"WorldThreadTag: globalMind not initialized");
}
return mind::globalMind->world.thread->getIoService();
return mind::globalMind->world.thread->getIoContext();
}
} // namespace smo
+1 -1
View File
@@ -18,7 +18,7 @@ constexpr unsigned int reattachInFlightStaleThresholdMultiplier = 4;
DeviceReattacher::DeviceReattacher(
DeviceManager& parent, std::shared_ptr<sscl::ComponentThread> ioThread)
: parent(parent), ioThread(ioThread), timer(ioThread->getIoService())
: parent(parent), ioThread(ioThread), timer(ioThread->getIoContext())
{
}
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef SMO_BODY_THREAD_H
#define SMO_BODY_THREAD_H
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
#include <spinscale/co/invokers.h>
#include <spinscale/co/postingPromise.h>
@@ -10,7 +10,7 @@ namespace body {
struct BodyThreadTag
{
static boost::asio::io_service &io_service();
static boost::asio::io_context &io_context();
};
template <typename T>
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef SMO_DIRECTOR_THREAD_H
#define SMO_DIRECTOR_THREAD_H
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
#include <spinscale/co/invokers.h>
#include <spinscale/co/postingPromise.h>
@@ -10,7 +10,7 @@ namespace director {
struct DirectorThreadTag
{
static boost::asio::io_service &io_service();
static boost::asio::io_context &io_context();
};
template <typename T>
@@ -1,7 +1,7 @@
#ifndef SMO_MARIONETTE_THREAD_H
#define SMO_MARIONETTE_THREAD_H
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
#include <spinscale/co/invokers.h>
#include <spinscale/co/postingPromise.h>
@@ -10,7 +10,7 @@ namespace mrntt {
struct MrnttThreadTag
{
static boost::asio::io_service &io_service() noexcept;
static boost::asio::io_context &io_context() noexcept;
};
template <typename T>
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef SMO_SIMULATOR_THREAD_H
#define SMO_SIMULATOR_THREAD_H
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
#include <spinscale/co/invokers.h>
#include <spinscale/co/postingPromise.h>
@@ -10,7 +10,7 @@ namespace simulator {
struct SimulatorThreadTag
{
static boost::asio::io_service &io_service();
static boost::asio::io_context &io_context();
};
template <typename T>
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef SMO_SUBCONSCIOUS_THREAD_H
#define SMO_SUBCONSCIOUS_THREAD_H
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
#include <spinscale/co/invokers.h>
#include <spinscale/co/postingPromise.h>
@@ -9,7 +9,7 @@ namespace smo {
struct SubconsciousThreadTag
{
static boost::asio::io_service &io_service();
static boost::asio::io_context &io_context();
};
template <typename T>
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef SMO_WORLD_THREAD_H
#define SMO_WORLD_THREAD_H
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
#include <spinscale/co/invokers.h>
#include <spinscale/co/postingPromise.h>
@@ -9,7 +9,7 @@ namespace smo {
struct WorldThreadTag
{
static boost::asio::io_service &io_service();
static boost::asio::io_context &io_context();
};
template <typename T>
+1 -1
View File
@@ -103,7 +103,7 @@ void MarionetteComponent::exceptionInd()
auto puppeteer = sscl::ComponentThread::getPptr();
boost::asio::post(
puppeteer->getIoService(),
puppeteer->getIoContext(),
[]
{
mrntt.holdFinalizeCReq(
+1 -1
View File
@@ -63,7 +63,7 @@ void MarionetteComponent::postJoltHook()
// Register SIGINT (Ctrl+C) and SIGSEGV handlers
signals = std::make_unique<boost::asio::signal_set>(
th->getIoService(), SIGINT);
th->getIoContext(), SIGINT);
signals->async_wait(
[](const boost::system::error_code& ec, int signal)