1
0
Fork 0
mirror of https://gitlab.com/niansa/cosched.git synced 2025-03-06 20:53:26 +01:00

Fixed warnings and added Task::is_dead()

This commit is contained in:
niansa 2023-05-06 01:13:50 +02:00
parent 32bfe1dbac
commit 666a9aee3f
2 changed files with 7 additions and 2 deletions

View file

@ -156,8 +156,8 @@ class AwaitableTask : public detail::TaskBase<detail::AwaitablePromise<T>>
public:
using Base::Base;
class awaiter;
friend class awaiter;
struct awaiter;
friend struct awaiter;
awaiter operator co_await() const;
};

View file

@ -103,6 +103,11 @@ public:
return suspended;
}
// Returns if task is dead
bool is_dead() const {
return state == TaskState::dead;
}
// Allows other tasks to execute
AwaitableTask<bool> yield();
};