34#if YACLIB_SYMMETRIC_TRANSFER != 0
44 template <
bool SymmetricTransfer>
49 if (this->SubEqual(1)) {
58template <
typename Handle>
68 template <
typename Promise>
69 YACLIB_INLINE
void await_suspend(yaclib_std::coroutine_handle<Promise> handle)
noexcept {
70 auto& core = handle.promise();
71 core._executor = &_executor;
72 Handle caller_handle{*job};
75 if (!caller_handle.SetCallback(*
this)) {
76 _executor.Submit(core);
87template <
typename Event>
90 static constexpr auto kShared = Event::kShared;
92 template <
typename... Handles>
94 :
Event{
sizeof...(handles) + 1}, _executor{e} {
95 SetCallbacksStatic(*
this, handles...);
98 template <
typename It>
100 SetCallbacksDynamic(*
this, it, count);
107 template <
typename Promise>
108 YACLIB_INLINE
void await_suspend(yaclib_std::coroutine_handle<Promise> handle)
noexcept {
109 auto& core = handle.promise();
110 core._executor = &_executor;
113 if (this->SubEqual(1)) {
114 _executor.Submit(core);
virtual void Submit(Job &job) noexcept=0
Submit given job.
AwaitOnEvent(std::size_t n) noexcept
InlineCore * Here(InlineCore &caller) noexcept final
AwaitOnEvent & GetCall() noexcept
static constexpr auto kShared
constexpr void await_resume() const noexcept
YACLIB_INLINE void await_suspend(yaclib_std::coroutine_handle< Promise > handle) noexcept
MultiAwaitOnAwaiter(IExecutor &e, Handles... handles) noexcept
constexpr bool await_ready() const noexcept
MultiAwaitOnAwaiter(IExecutor &e, It it, std::size_t count) noexcept
#define YACLIB_ASSERT(cond)
std::conditional_t< Single, OneCounter< NopeBase, NopeDeleter >, AtomicCounter< NopeBase, NopeDeleter > > AwaitOnCounterT
Contract< V, E > MakeContract()
Creates related future and promise.
constexpr void await_resume() const noexcept
YACLIB_INLINE void await_suspend(yaclib_std::coroutine_handle< Promise > handle) noexcept
constexpr bool await_ready() const noexcept
AwaitOnAwaiter(IExecutor &e, Handle caller) noexcept