Do not set POSIX thread scheduler policy on systems reporting that they do not support it

This commit is contained in:
Louis du Verdier
2025-10-26 16:17:58 +01:00
committed by David Reid
parent 6a895501cf
commit 6d65be5e0e
+1 -1
View File
@@ -17616,7 +17616,7 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
int priorityStep = (priorityMax - priorityMin) / 7; /* 7 = number of priorities supported by miniaudio. */
struct sched_param sched;
if (pthread_attr_getschedparam(&attr, &sched) == 0) {
if (priorityMin != -1 && priorityMax != -1 && pthread_attr_getschedparam(&attr, &sched) == 0) {
if (priority == ma_thread_priority_idle) {
sched.sched_priority = priorityMin;
} else if (priority == ma_thread_priority_realtime) {