mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 12:48:14 +00:00
can use sync.guard here
This commit is contained in:
@@ -98,10 +98,9 @@ _create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^
|
|||||||
}
|
}
|
||||||
|
|
||||||
_start :: proc(t: ^Thread) {
|
_start :: proc(t: ^Thread) {
|
||||||
sync.lock(&t.mutex)
|
sync.guard(&t.mutex)
|
||||||
t.flags += { .Started }
|
t.flags += { .Started }
|
||||||
sync.signal(&t.cond)
|
sync.signal(&t.cond)
|
||||||
sync.unlock(&t.mutex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_is_done :: proc(t: ^Thread) -> bool {
|
_is_done :: proc(t: ^Thread) -> bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user