Default to pthreads in sync2 for *nix

This commit is contained in:
gingerBill
2021-04-13 19:04:44 +01:00
parent 12296a0dcc
commit bee8beb2c9
5 changed files with 12 additions and 18 deletions
+3 -3
View File
@@ -3,7 +3,7 @@
package thread
import "core:runtime"
import "core:sync"
import sync "core:sync/sync2"
import win32 "core:sys/windows"
Thread_Os_Specific :: struct {
@@ -38,7 +38,7 @@ _create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^
}
}
sync.atomic_store(&t.done, true, .Sequentially_Consistent);
sync.atomic_store(&t.done, true);
return 0;
}
@@ -73,7 +73,7 @@ _is_done :: proc(using thread: ^Thread) -> bool {
// NOTE(tetra, 2019-10-31): Apparently using wait_for_single_object and
// checking if it didn't time out immediately, is not good enough,
// so we do it this way instead.
return sync.atomic_load(&done, .Sequentially_Consistent);
return sync.atomic_load(&done);
}
_join :: proc(using thread: ^Thread) {