1
0
Fork 0
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:
niansa/tuxifan 2023-05-05 15:22:33 +02:00
parent c016ccd672
commit 83e375a1e0

View file

@ -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));
}
}