aboutsummaryrefslogtreecommitdiff
path: root/core/thread
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-09-23 17:17:14 +0100
committergingerBill <bill@gingerbill.org>2020-09-23 17:17:14 +0100
commitfc4fdd588e5bd0c45d04c792267a0f4434c6a38e (patch)
tree59bcddc60248dd78ed1155dd7a6ae7ae3de2e07e /core/thread
parent4844dd4d96f0921f44e70c9960d3e4476aad7115 (diff)
Remove usage of `do` in core library
Diffstat (limited to 'core/thread')
-rw-r--r--core/thread/thread_unix.odin12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/thread/thread_unix.odin b/core/thread/thread_unix.odin
index 221cb2c89..027ffe026 100644
--- a/core/thread/thread_unix.odin
+++ b/core/thread/thread_unix.odin
@@ -72,7 +72,9 @@ create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^T
}
attrs: unix.pthread_attr_t;
- if unix.pthread_attr_init(&attrs) != 0 do return nil; // NOTE(tetra, 2019-11-01): POSIX OOM.
+ if unix.pthread_attr_init(&attrs) != 0 {
+ return nil; // NOTE(tetra, 2019-11-01): POSIX OOM.
+ }
defer unix.pthread_attr_destroy(&attrs);
// NOTE(tetra, 2019-11-01): These only fail if their argument is invalid.
@@ -80,7 +82,9 @@ create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^T
assert(unix.pthread_attr_setinheritsched(&attrs, unix.PTHREAD_EXPLICIT_SCHED) == 0);
thread := new(Thread);
- if thread == nil do return nil;
+ if thread == nil {
+ return nil;
+ }
// Set thread priority.
policy: i32;
@@ -111,7 +115,9 @@ create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^T
}
start :: proc(t: ^Thread) {
- if sync.atomic_swap(&t.started, true, .Sequentially_Consistent) do return;
+ if sync.atomic_swap(&t.started, true, .Sequentially_Consistent) {
+ return;
+ }
sync.condition_signal(&t.start_gate);
}