mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Fix a threading issue with PS Vita.
This commit is contained in:
+18
-1
@@ -17919,7 +17919,7 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
|
|||||||
int result;
|
int result;
|
||||||
pthread_attr_t* pAttr = NULL;
|
pthread_attr_t* pAttr = NULL;
|
||||||
|
|
||||||
#if !defined(MA_EMSCRIPTEN) && !defined(MA_N3DS) && !defined(MA_SWITCH) && !defined(MA_DREAMCAST)
|
#if !defined(MA_EMSCRIPTEN) && !defined(MA_N3DS) && !defined(MA_SWITCH) && !defined(MA_DREAMCAST) && !defined(MA_VITA)
|
||||||
/* Try setting the thread priority. It's not critical if anything fails here. */
|
/* Try setting the thread priority. It's not critical if anything fails here. */
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
if (pthread_attr_init(&attr) == 0) {
|
if (pthread_attr_init(&attr) == 0) {
|
||||||
@@ -17955,6 +17955,23 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
|
|||||||
{
|
{
|
||||||
if (stackSize > 0) {
|
if (stackSize > 0) {
|
||||||
pthread_attr_setstacksize(&attr, stackSize);
|
pthread_attr_setstacksize(&attr, stackSize);
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
Note for Vita SDK
|
||||||
|
|
||||||
|
When using pthread_attr_t (this path we're in now), the default stack size seems to be too small. If the
|
||||||
|
pthread_attr_t path is skipped entirely, things work fine. It looks like skipping the call to
|
||||||
|
pthread_attr_setstacksize(), which happens when stackSize is 0, the chosen stack size is smaller than
|
||||||
|
what it would be if we skipped the pthread_attr_t path.
|
||||||
|
|
||||||
|
There are two work arounds for this. The first is to always skip the pthread_attr_t path. The second is
|
||||||
|
to have a specialized path here for Vita and explicitly default to something bigger. I'm doing both.
|
||||||
|
*/
|
||||||
|
#if defined(MA_VITA)
|
||||||
|
{
|
||||||
|
pthread_attr_setstacksize(&attr, 0x10000);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user