mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
Regress to io_service rather than io_context
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user