mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
Call std::terminate if await_* are called on NonViral*Invoker
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <coroutine>
|
#include <coroutine>
|
||||||
|
#include <exception>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@@ -59,26 +60,13 @@ struct NonViralNonSuspendingInvoker
|
|||||||
using PostingInvoker<PostingPromiseTemplate<void>, void>::PostingInvoker;
|
using PostingInvoker<PostingPromiseTemplate<void>, void>::PostingInvoker;
|
||||||
|
|
||||||
bool await_ready() const noexcept
|
bool await_ready() const noexcept
|
||||||
{
|
{ std::terminate(); }
|
||||||
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
|
||||||
std::cout << __func__ << ": " << std::this_thread::get_id() << " This shouldn't be called.\n";
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void await_suspend(std::coroutine_handle<NonViralNonSuspendingInvoker<PostingPromiseTemplate>>) noexcept
|
void await_suspend(std::coroutine_handle<NonViralNonSuspendingInvoker<PostingPromiseTemplate>>) noexcept
|
||||||
{
|
{ std::terminate(); }
|
||||||
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
|
||||||
std::cout << __func__ << ": " << std::this_thread::get_id() << " This shouldn't be called.\n";
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void await_resume() noexcept
|
void await_resume() noexcept
|
||||||
{
|
{ std::terminate(); }
|
||||||
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
|
||||||
std::cout << __func__ << ": " << std::this_thread::get_id() << " This shouldn't be called.\n";
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Viral awaitable: promise_type inherits PostingPromiseTemplate<T> (posting
|
/** Viral awaitable: promise_type inherits PostingPromiseTemplate<T> (posting
|
||||||
|
|||||||
Reference in New Issue
Block a user