mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
sync.yield_processor -> sync.cpu_relax; have it call intrinsics.cpu_relax
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
package thread;
|
||||
|
||||
import "core:runtime"
|
||||
import "core:intrinsics"
|
||||
import "core:sync"
|
||||
import "core:sys/unix"
|
||||
|
||||
@@ -134,7 +135,7 @@ join :: proc(t: ^Thread) {
|
||||
if sync.atomic_swap(&t.already_joined, true, .Sequentially_Consistent) {
|
||||
for {
|
||||
if sync.atomic_load(&t.done, .Sequentially_Consistent) do return;
|
||||
sync.yield_processor();
|
||||
intrinsics.cpu_relax();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user