Regress to io_service rather than io_context

This commit is contained in:
2026-05-17 17:12:11 -04:00
parent 0dcfa754b6
commit 1d1cb099db
+5 -6
View File
@@ -10,7 +10,6 @@
#include <type_traits>
#include <utility>
#include <boost/asio/io_context.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/post.hpp>
@@ -191,19 +190,19 @@ struct PostingPromise
: public std::suspend_always
{
InitialSuspendPostingInvoker(
boost::asio::io_context &targetIoContextIn,
boost::asio::io_service &targetIoServiceIn,
std::coroutine_handle<> targetSchedHandleIn) noexcept
: targetIoContext(targetIoContextIn),
: targetIoService(targetIoServiceIn),
targetSchedHandle(targetSchedHandleIn)
{}
bool await_suspend(std::coroutine_handle<> const) noexcept
{
boost::asio::post(targetIoContext, targetSchedHandle);
boost::asio::post(targetIoService, targetSchedHandle);
return true;
}
boost::asio::io_context &targetIoContext;
boost::asio::io_service &targetIoService;
std::coroutine_handle<> targetSchedHandle;
};
@@ -353,7 +352,7 @@ struct TaggedPostingPromise
std::cout << __func__ << ": " << std::this_thread::get_id() << " Returning InitialSuspendPostingInvoker.\n";
#endif
return typename PostingPromise<T>::InitialSuspendPostingInvoker(
ThreadTag::io_context(),
ThreadTag::io_service(),
this->selfSchedHandle);
}
};