rosalina: lower thread prios & make task runner take termination into account

This commit is contained in:
TuxSH 2020-04-26 19:36:59 +01:00
parent b313a4aa2f
commit e677e0142c
4 changed files with 11 additions and 8 deletions

View File

@ -21,7 +21,7 @@ AccessControlInfo:
IdealProcessor : 1 IdealProcessor : 1
AffinityMask : 3 AffinityMask : 3
Priority : 20 Priority : 25 # 55
DisableDebug : false DisableDebug : false
EnableForceDebug : true EnableForceDebug : true

View File

@ -48,7 +48,7 @@ static char staticBuf[0x100 + 1] = {0};
MyThread *errDispCreateThread(void) MyThread *errDispCreateThread(void)
{ {
if(R_FAILED(MyThread_Create(&errDispThread, errDispThreadMain, errDispThreadStack, 0xD00, 0x18, CORE_SYSTEM))) if(R_FAILED(MyThread_Create(&errDispThread, errDispThreadMain, errDispThreadStack, 0xD00, 55, CORE_SYSTEM)))
svcBreak(USERBREAK_PANIC); svcBreak(USERBREAK_PANIC);
return &errDispThread; return &errDispThread;
} }

View File

@ -90,13 +90,14 @@ void exit(int rc)
// TODO: make pm terminate rosalina // TODO: make pm terminate rosalina
__libc_fini_array(); __libc_fini_array();
acExit(); // Kernel will take care of it all
/*acExit();
pmDbgExit(); pmDbgExit();
fsExit(); fsExit();
svcCloseHandle(*fsRegGetSessionHandle()); svcCloseHandle(*fsRegGetSessionHandle());
srvExit(); srvExit();
__sync_fini();*/
__sync_fini();
svcExitProcess(); svcExitProcess();
} }

View File

@ -7,10 +7,12 @@ TaskRunner g_taskRunner;
static MyThread taskRunnerThread; static MyThread taskRunnerThread;
static u8 ALIGN(8) taskRunnerThreadStack[0x1000]; static u8 ALIGN(8) taskRunnerThreadStack[0x1000];
extern bool terminationRequest;
MyThread *taskRunnerCreateThread(void) MyThread *taskRunnerCreateThread(void)
{ {
TaskRunner_Init(); TaskRunner_Init();
MyThread_Create(&taskRunnerThread, TaskRunner_HandleTasks, taskRunnerThreadStack, THREAD_STACK_SIZE, 0x20, 1); MyThread_Create(&taskRunnerThread, TaskRunner_HandleTasks, taskRunnerThreadStack, THREAD_STACK_SIZE, 58, 1);
return &taskRunnerThread; return &taskRunnerThread;
} }
@ -32,7 +34,7 @@ void TaskRunner_RunTask(void (*task)(void *argdata), void *argdata, size_t argsi
void TaskRunner_HandleTasks(void) void TaskRunner_HandleTasks(void)
{ {
for (;;) { while (!terminationRequest) {
LightEvent_Signal(&g_taskRunner.readyEvent); LightEvent_Signal(&g_taskRunner.readyEvent);
LightEvent_Wait(&g_taskRunner.parametersSetEvent); LightEvent_Wait(&g_taskRunner.parametersSetEvent);
g_taskRunner.task(g_taskRunner.argStorage); g_taskRunner.task(g_taskRunner.argStorage);