diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-07-16 18:44:18 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-07-16 18:44:18 +0200 |
| commit | 28fac62a022b147042bc0e1c49a89f7fe611e19c (patch) | |
| tree | 1cf180c05e6cc06ac91d95cb1fbd8589c179bc91 /core/thread | |
| parent | 03426175aea8b3d3a1ebea550613f2155ea07f9a (diff) | |
fix some bugs with -disable-assert
Diffstat (limited to 'core/thread')
| -rw-r--r-- | core/thread/thread_unix.odin | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/thread/thread_unix.odin b/core/thread/thread_unix.odin index 363f50862..f56454bfc 100644 --- a/core/thread/thread_unix.odin +++ b/core/thread/thread_unix.odin @@ -81,9 +81,12 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread { defer unix.pthread_attr_destroy(&attrs) // NOTE(tetra, 2019-11-01): These only fail if their argument is invalid. - assert(unix.pthread_attr_setdetachstate(&attrs, unix.PTHREAD_CREATE_JOINABLE) == 0) + res: i32 + res = unix.pthread_attr_setdetachstate(&attrs, unix.PTHREAD_CREATE_JOINABLE) + assert(res == 0) when ODIN_OS != .Haiku && ODIN_OS != .NetBSD { - assert(unix.pthread_attr_setinheritsched(&attrs, unix.PTHREAD_EXPLICIT_SCHED) == 0) + res = unix.pthread_attr_setinheritsched(&attrs, unix.PTHREAD_EXPLICIT_SCHED) + assert(res == 0) } thread := new(Thread) @@ -94,7 +97,6 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread { // Set thread priority. policy: i32 - res: i32 when ODIN_OS != .Haiku && ODIN_OS != .NetBSD { res = unix.pthread_attr_getschedpolicy(&attrs, &policy) assert(res == 0) |