From bf13da990a0baf9c412276fd1b0f950968332072 Mon Sep 17 00:00:00 2001 From: fincs Date: Sat, 23 Feb 2019 21:09:41 +0100 Subject: [PATCH] Critical fix in new barrier impl --- nx/source/kernel/barrier.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx/source/kernel/barrier.c b/nx/source/kernel/barrier.c index f11f4f1b..d3f3703e 100644 --- a/nx/source/kernel/barrier.c +++ b/nx/source/kernel/barrier.c @@ -11,11 +11,11 @@ void barrierWait(Barrier *b) { mutexLock(&b->mutex); if (b->count++ == b->total) { - b->count = 0; - condvarWake(&b->condvar, b->total); + b->count = 0; + condvarWake(&b->condvar, b->total); } else { - condvarWait(&b->condvar, &b->mutex); + condvarWait(&b->condvar, &b->mutex); } mutexUnlock(&b->mutex);