mirror of
https://gitlab.com/niansa/cosched.git
synced 2025-03-06 20:53:26 +01:00
Fixed delete_task deleting running tasks
This commit is contained in:
parent
c016ccd672
commit
83e375a1e0
1 changed files with 2 additions and 2 deletions
|
@ -42,8 +42,8 @@ AwaitableTask<bool> Task::yield() {
|
|||
|
||||
|
||||
void Scheduler::clean_task(Task *task) {
|
||||
// If current task isn't sleeping, it is considered a zombie so removed from list
|
||||
if (task && task->state != TaskState::sleeping) {
|
||||
// If current task has no way to resume, it is considered a zombie so removed from list
|
||||
if (task && task->resume_event == nullptr) {
|
||||
delete_task(std::exchange(task, nullptr));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue