mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Replace usage of inline proc with #force_inline proc in the core library
This commit is contained in:
+3
-3
@@ -3,7 +3,7 @@ package sync
|
||||
import "intrinsics"
|
||||
import "core:runtime"
|
||||
|
||||
cpu_relax :: inline proc "contextless" () {
|
||||
cpu_relax :: #force_inline proc "contextless" () {
|
||||
intrinsics.cpu_relax();
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@ ticket_mutex_init :: proc(m: ^Ticket_Mutex) {
|
||||
atomic_store(&m.serving, 0, .Relaxed);
|
||||
}
|
||||
|
||||
ticket_mutex_lock :: inline proc(m: ^Ticket_Mutex) {
|
||||
ticket_mutex_lock :: #force_inline proc(m: ^Ticket_Mutex) {
|
||||
ticket := atomic_add(&m.ticket, 1, .Relaxed);
|
||||
for ticket != atomic_load(&m.serving, .Acquire) {
|
||||
intrinsics.cpu_relax();
|
||||
}
|
||||
}
|
||||
|
||||
ticket_mutex_unlock :: inline proc(m: ^Ticket_Mutex) {
|
||||
ticket_mutex_unlock :: #force_inline proc(m: ^Ticket_Mutex) {
|
||||
atomic_add(&m.serving, 1, .Relaxed);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user