mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-24 04:35:03 +00:00
n3ds systhread - prefer to put audio thread on system core
This commit is contained in:
parent
6623c87d0b
commit
301ee21f33
|
@ -49,15 +49,22 @@ static void ThreadEntry(void *arg)
|
||||||
|
|
||||||
int SDL_SYS_CreateThread(SDL_Thread *thread)
|
int SDL_SYS_CreateThread(SDL_Thread *thread)
|
||||||
{
|
{
|
||||||
s32 priority;
|
s32 priority = 0x30;
|
||||||
|
int cpu = -1;
|
||||||
size_t stack_size = GetStackSize(thread->stacksize);
|
size_t stack_size = GetStackSize(thread->stacksize);
|
||||||
|
|
||||||
svcGetThreadPriority(&priority, CUR_THREAD_HANDLE);
|
svcGetThreadPriority(&priority, CUR_THREAD_HANDLE);
|
||||||
|
|
||||||
|
/* prefer putting audio thread on system core */
|
||||||
|
if (thread->name && SDL_strcmp(thread->name, "SDLAudioP") == 0 && R_SUCCEEDED(APT_SetAppCpuTimeLimit(30))) {
|
||||||
|
cpu = 1;
|
||||||
|
}
|
||||||
|
|
||||||
thread->handle = threadCreate(ThreadEntry,
|
thread->handle = threadCreate(ThreadEntry,
|
||||||
thread,
|
thread,
|
||||||
stack_size,
|
stack_size,
|
||||||
priority,
|
priority,
|
||||||
-1,
|
cpu,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
if (thread->handle == NULL) {
|
if (thread->handle == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue