Replace usage of inline proc with #force_inline proc in the core library

This commit is contained in:
gingerBill
2021-02-23 16:14:47 +00:00
parent 41b854f192
commit aa93305015
26 changed files with 182 additions and 182 deletions
+3 -3
View File
@@ -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);
}