can use sync.guard here

This commit is contained in:
Dale Weiler
2022-03-11 08:41:03 -05:00
parent 32ba5e7ad2
commit 3da8fa9b27

View File

@@ -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 {