From: Brendan Hansen Date: Mon, 18 Oct 2021 16:13:58 +0000 (-0500) Subject: bugfix with barrier mutex X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=e120a0311f6187ff3b86dc8a6b572f16f6eb2fd5;p=onyx.git bugfix with barrier mutex --- 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