mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
Fix some bugs with initialization of POSIX threads.
This commit is contained in:
@@ -2,6 +2,7 @@ v0.11.12 - TBD
|
|||||||
=====================
|
=====================
|
||||||
* Fix a crash due to a race condition in the resource manager.
|
* Fix a crash due to a race condition in the resource manager.
|
||||||
* Fix a crash with some backends when rerouting the playback side of a duplex device.
|
* Fix a crash with some backends when rerouting the playback side of a duplex device.
|
||||||
|
* Fix some bugs with initialization of POSIX threads.
|
||||||
|
|
||||||
|
|
||||||
v0.11.11 - 2022-11-04
|
v0.11.11 - 2022-11-04
|
||||||
|
|||||||
+6
-3
@@ -15852,6 +15852,10 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
|
|||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
if (pthread_attr_init(&attr) == 0) {
|
if (pthread_attr_init(&attr) == 0) {
|
||||||
int scheduler = -1;
|
int scheduler = -1;
|
||||||
|
|
||||||
|
/* We successfully initialized our attributes object so we can assign the pointer so it's passed into pthread_create(). */
|
||||||
|
pAttr = &attr;
|
||||||
|
|
||||||
if (priority == ma_thread_priority_idle) {
|
if (priority == ma_thread_priority_idle) {
|
||||||
#ifdef SCHED_IDLE
|
#ifdef SCHED_IDLE
|
||||||
if (pthread_attr_setschedpolicy(&attr, SCHED_IDLE) == 0) {
|
if (pthread_attr_setschedpolicy(&attr, SCHED_IDLE) == 0) {
|
||||||
@@ -15895,9 +15899,8 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_attr_setschedparam(&attr, &sched) == 0) {
|
/* I'm not treating a failure of setting the priority as a critical error so not checking the return value here. */
|
||||||
pAttr = &attr;
|
pthread_attr_setschedparam(&attr, &sched);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user