Use contextless procs in core:sync instead

This commit is contained in:
Feoramund
2024-09-10 14:52:20 -04:00
parent c3f363cfbc
commit 0a594147af
9 changed files with 33 additions and 49 deletions
+1 -17
View File
@@ -1,6 +1,5 @@
package sync
import "base:runtime"
import "core:time"
/*
@@ -560,7 +559,7 @@ futex_wait :: proc "contextless" (f: ^Futex, expected: u32) {
return
}
ok := _futex_wait(f, expected)
_assert(ok, "futex_wait failure")
assert_contextless(ok, "futex_wait failure")
}
/*
@@ -597,18 +596,3 @@ Wake up multiple threads waiting on a futex.
futex_broadcast :: proc "contextless" (f: ^Futex) {
_futex_broadcast(f)
}
@(private)
_assert :: proc "contextless" (cond: bool, msg: string) {
if !cond {
_panic(msg)
}
}
@(private)
_panic :: proc "contextless" (msg: string) -> ! {
runtime.print_string(msg)
runtime.print_byte('\n')
runtime.trap()
}