sync.yield_processor -> sync.cpu_relax; have it call intrinsics.cpu_relax

This commit is contained in:
Tetralux
2020-04-21 16:07:18 +00:00
parent 2c91c21021
commit 8dd1b61aa2
2 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -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();
}
}