diff options
| author | Dale Weiler <weilercdale@gmail.com> | 2022-03-11 08:41:03 -0500 |
|---|---|---|
| committer | Dale Weiler <weilercdale@gmail.com> | 2022-03-11 08:41:03 -0500 |
| commit | 3da8fa9b27a399d465f616c779d24de00a60e4a1 (patch) | |
| tree | 30fc8dd1beb102078e5e5864465c336febbe38f3 | |
| parent | 32ba5e7ad2e7d814835da2590462a586b33862d0 (diff) | |
can use sync.guard here
| -rw-r--r-- | core/thread/thread_unix.odin | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/thread/thread_unix.odin b/core/thread/thread_unix.odin index 38bf8241d..fbf89f122 100644 --- a/core/thread/thread_unix.odin +++ b/core/thread/thread_unix.odin @@ -98,10 +98,9 @@ _create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^ } _start :: proc(t: ^Thread) { - sync.lock(&t.mutex) + sync.guard(&t.mutex) t.flags += { .Started } sync.signal(&t.cond) - sync.unlock(&t.mutex) } _is_done :: proc(t: ^Thread) -> bool { |