From e120a0311f6187ff3b86dc8a6b572f16f6eb2fd5 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 18 Oct 2021 11:13:58 -0500 Subject: [PATCH] bugfix with barrier mutex --- core/sync/barrier.onyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/sync/barrier.onyx b/core/sync/barrier.onyx index 6f90e9a3..fe954288 100644 --- a/core/sync/barrier.onyx +++ b/core/sync/barrier.onyx @@ -24,7 +24,7 @@ barrier_destroy :: (b: ^Barrier) { } barrier_wait :: (b: ^Barrier) { - scoped_mutex(^b.mutex); + mutex_lock(^b.mutex); local_gen := b.generation; b.index += 1; @@ -41,5 +41,7 @@ barrier_wait :: (b: ^Barrier) { b.index = 0; b.generation += 1; condition_broadcast(^b.cond); + + mutex_unlock(^b.mutex); return; } \ No newline at end of file -- 2.25.1