aboutsummaryrefslogtreecommitdiff
path: root/core/sync/sync.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-06-08 15:57:00 +0100
committergingerBill <bill@gingerbill.org>2021-06-08 15:57:00 +0100
commit8ec2ca9dcd138f6f5e49cd3f6c6bb575a7e434e7 (patch)
treea30e214bceb68e34bcb6191a3abd4d1c54762fd3 /core/sync/sync.odin
parentf19bb0f4d45ba4352c4392807ca2b1efe5918ea7 (diff)
Remove `context.thread_id`
Diffstat (limited to 'core/sync/sync.odin')
-rw-r--r--core/sync/sync.odin6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/sync/sync.odin b/core/sync/sync.odin
index 06ec043bc..60d226d20 100644
--- a/core/sync/sync.odin
+++ b/core/sync/sync.odin
@@ -80,7 +80,7 @@ recursive_benaphore_destroy :: proc(b: ^Recursive_Benaphore) {
}
recursive_benaphore_lock :: proc(b: ^Recursive_Benaphore) {
- tid := runtime.current_thread_id();
+ tid := current_thread_id();
if intrinsics.atomic_add_acq(&b.counter, 1) > 1 {
if tid != b.owner {
semaphore_wait_for(&b.sema);
@@ -92,7 +92,7 @@ recursive_benaphore_lock :: proc(b: ^Recursive_Benaphore) {
}
recursive_benaphore_try_lock :: proc(b: ^Recursive_Benaphore) -> bool {
- tid := runtime.current_thread_id();
+ tid := current_thread_id();
if b.owner == tid {
intrinsics.atomic_add_acq(&b.counter, 1);
} else {
@@ -108,7 +108,7 @@ recursive_benaphore_try_lock :: proc(b: ^Recursive_Benaphore) -> bool {
}
recursive_benaphore_unlock :: proc(b: ^Recursive_Benaphore) {
- tid := runtime.current_thread_id();
+ tid := current_thread_id();
assert(tid == b.owner);
b.recursion -= 1;
recursion := b.recursion;