From 41d4dfbcd5d0d977ac01170fcc236a099af34f90 Mon Sep 17 00:00:00 2001 From: Andreas T Jonsson Date: Thu, 18 Apr 2024 16:20:49 +0200 Subject: [PATCH] Fixed concurrency issue Fixed broken thread policy causing deadlocks. --- core/thread/thread_unix.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/thread/thread_unix.odin b/core/thread/thread_unix.odin index c80d6854b..e25d3541c 100644 --- a/core/thread/thread_unix.odin +++ b/core/thread/thread_unix.odin @@ -78,7 +78,7 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread { // NOTE(tetra, 2019-11-01): These only fail if their argument is invalid. assert(unix.pthread_attr_setdetachstate(&attrs, unix.PTHREAD_CREATE_JOINABLE) == 0) - when ODIN_OS != .Haiku { + when ODIN_OS != .Haiku && ODIN_OS != .NetBSD { assert(unix.pthread_attr_setinheritsched(&attrs, unix.PTHREAD_EXPLICIT_SCHED) == 0) } @@ -91,7 +91,7 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread { // Set thread priority. policy: i32 res: i32 - when ODIN_OS != .Haiku { + when ODIN_OS != .Haiku && ODIN_OS != .NetBSD { res = unix.pthread_attr_getschedpolicy(&attrs, &policy) assert(res == 0) }