From 26b536958dff79de6f32d50baad578d791b2549e Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 21 Apr 2024 15:08:58 +0200 Subject: [PATCH] =?UTF-8?q?+=20claire=20comme=20=C3=A7a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sched.c b/src/sched.c index 58347ed..2e61af4 100644 --- a/src/sched.c +++ b/src/sched.c @@ -195,7 +195,8 @@ sched_spawn(taskfunc f, void *closure, struct scheduler *s) return -1; } - s->tasks[0][++s->top[0]] = (struct task_info){closure, f}; + s->top[0]++; + s->tasks[0][s->top[0]] = (struct task_info){closure, f}; pthread_cond_signal(&s->cond[0]); pthread_mutex_unlock(&s->mutex[0]);