mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Change futex_wait_with_timeout to return a boolean rather than an enum
This commit is contained in:
@@ -20,13 +20,13 @@ foreign Synchronization {
|
||||
|
||||
|
||||
|
||||
_futex_wait :: proc(f: ^Futex, expect: u32) -> Futex_Error {
|
||||
_futex_wait :: proc(f: ^Futex, expect: u32) -> bool {
|
||||
expect := expect
|
||||
ok := RtlWaitOnAddress(f, &expect, size_of(expect), nil)
|
||||
return nil if ok else .Timed_Out
|
||||
return bool(ok)
|
||||
}
|
||||
|
||||
_futex_wait_with_timeout :: proc(f: ^Futex, expect: u32, duration: time.Duration) -> Futex_Error {
|
||||
_futex_wait_with_timeout :: proc(f: ^Futex, expect: u32, duration: time.Duration) -> bool {
|
||||
expect := expect
|
||||
|
||||
timeout: i64
|
||||
@@ -38,7 +38,7 @@ _futex_wait_with_timeout :: proc(f: ^Futex, expect: u32, duration: time.Duration
|
||||
}
|
||||
\
|
||||
ok := RtlWaitOnAddress(f, &expect, size_of(expect), timeout_ptr)
|
||||
return nil if ok else .Timed_Out
|
||||
return bool(ok)
|
||||
}
|
||||
|
||||
_futex_wake_single :: proc(f: ^Futex) {
|
||||
|
||||
Reference in New Issue
Block a user