arm: cleanup dead async code

This commit is contained in:
2023-06-07 09:59:54 +02:00
parent 83c80f15be
commit 8c25ce8d21
2 changed files with 1 additions and 89 deletions

View File

@@ -27,66 +27,6 @@ struct task_final_suspend {
std::coroutine_handle<> parent;
};
#if 0
template <typename T>
struct gimme {
// child interface
bool await_ready() { return false; }
void await_suspend(std::coroutine_handle<> h) {
ha = h;
waiting = true;
TRACE(tracing::TraceEvent::kAsyncGimmeWaiting);
if (parent) {
TRACE(tracing::TraceEvent::kAsyncCallParent);
parent.resume();
TRACE(tracing::TraceEvent::kAsyncCallParentDone);
}
}
T await_resume() {
waiting = false;
TRACE(tracing::TraceEvent::kAsyncGimmeResume);
return std::move(stuff);
}
// parent interface
auto feed(T&& s) {
struct awaitable {
bool await_ready() {
if (g.waiting) {
return true;
}
// TODO: handle g.ha.done()
return false;
}
void await_suspend(std::coroutine_handle<> h) {
g.parent = h;
}
void await_resume() {}
gimme<T>& g;
};
if (!waiting) {
__builtin_trap();
}
if (!ha) {
__builtin_trap();
}
stuff = s;
parent = {};
ha.resume();
return awaitable{.g = *this};
}
bool waiting = false;
std::coroutine_handle<> ha;
T stuff;
std::coroutine_handle<> parent;
};
#else
template <typename T>
struct gimme {
// child interface
@@ -118,7 +58,6 @@ struct gimme {
std::coroutine_handle<> ha;
T stuff;
};
#endif
template <typename T = void>
struct task;