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:
parent
32bfe1dbac
commit
666a9aee3f
2 changed files with 7 additions and 2 deletions
|
@ -156,8 +156,8 @@ class AwaitableTask : public detail::TaskBase<detail::AwaitablePromise<T>>
|
||||||
public:
|
public:
|
||||||
using Base::Base;
|
using Base::Base;
|
||||||
|
|
||||||
class awaiter;
|
struct awaiter;
|
||||||
friend class awaiter;
|
friend struct awaiter;
|
||||||
awaiter operator co_await() const;
|
awaiter operator co_await() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,11 @@ public:
|
||||||
return suspended;
|
return suspended;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns if task is dead
|
||||||
|
bool is_dead() const {
|
||||||
|
return state == TaskState::dead;
|
||||||
|
}
|
||||||
|
|
||||||
// Allows other tasks to execute
|
// Allows other tasks to execute
|
||||||
AwaitableTask<bool> yield();
|
AwaitableTask<bool> yield();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue