Skip to content
Snippets Groups Projects
Commit 7339bbe7 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

wait, this was ok. the task might get consumed before the waiting counter is increased.

parent d6b95ea6
No related branches found
No related tags found
2 merge requests!136Master,!122Rewait fixes
......@@ -1134,12 +1134,12 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
/* If no previous owner, pick a random queue. */
if (qid < 0) qid = rand() % s->nr_queues;
/* Insert the task into that queue. */
queue_insert(&s->queues[qid], t);
/* Increase the waiting counter. */
atomic_inc(&s->waiting);
/* Insert the task into that queue. */
queue_insert(&s->queues[qid], t);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment