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 <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/asio/io_context.hpp>
|
|
||||||
#include <boost/asio/io_service.hpp>
|
#include <boost/asio/io_service.hpp>
|
||||||
#include <boost/asio/post.hpp>
|
#include <boost/asio/post.hpp>
|
||||||
|
|
||||||
@@ -191,19 +190,19 @@ struct PostingPromise
|
|||||||
: public std::suspend_always
|
: public std::suspend_always
|
||||||
{
|
{
|
||||||
InitialSuspendPostingInvoker(
|
InitialSuspendPostingInvoker(
|
||||||
boost::asio::io_context &targetIoContextIn,
|
boost::asio::io_service &targetIoServiceIn,
|
||||||
std::coroutine_handle<> targetSchedHandleIn) noexcept
|
std::coroutine_handle<> targetSchedHandleIn) noexcept
|
||||||
: targetIoContext(targetIoContextIn),
|
: targetIoService(targetIoServiceIn),
|
||||||
targetSchedHandle(targetSchedHandleIn)
|
targetSchedHandle(targetSchedHandleIn)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool await_suspend(std::coroutine_handle<> const) noexcept
|
bool await_suspend(std::coroutine_handle<> const) noexcept
|
||||||
{
|
{
|
||||||
boost::asio::post(targetIoContext, targetSchedHandle);
|
boost::asio::post(targetIoService, targetSchedHandle);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::asio::io_context &targetIoContext;
|
boost::asio::io_service &targetIoService;
|
||||||
std::coroutine_handle<> targetSchedHandle;
|
std::coroutine_handle<> targetSchedHandle;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -353,7 +352,7 @@ struct TaggedPostingPromise
|
|||||||
std::cout << __func__ << ": " << std::this_thread::get_id() << " Returning InitialSuspendPostingInvoker.\n";
|
std::cout << __func__ << ": " << std::this_thread::get_id() << " Returning InitialSuspendPostingInvoker.\n";
|
||||||
#endif
|
#endif
|
||||||
return typename PostingPromise<T>::InitialSuspendPostingInvoker(
|
return typename PostingPromise<T>::InitialSuspendPostingInvoker(
|
||||||
ThreadTag::io_context(),
|
ThreadTag::io_service(),
|
||||||
this->selfSchedHandle);
|
this->selfSchedHandle);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user