mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
sync: fix deadlock in one shot event
This commit is contained in:
@@ -433,7 +433,7 @@ One_Shot_Event :: struct #no_copy {
|
|||||||
// Blocks the current thread until the event is made available with `one_shot_event_signal`.
|
// Blocks the current thread until the event is made available with `one_shot_event_signal`.
|
||||||
one_shot_event_wait :: proc "contextless" (e: ^One_Shot_Event) {
|
one_shot_event_wait :: proc "contextless" (e: ^One_Shot_Event) {
|
||||||
for atomic_load_explicit(&e.state, .Acquire) == 0 {
|
for atomic_load_explicit(&e.state, .Acquire) == 0 {
|
||||||
futex_wait(&e.state, 1)
|
futex_wait(&e.state, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user