MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / lowerPriority

Method lowerPriority

3ds/source/script/scripthost.cpp:499–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497 }
498
499 void lowerPriority(void) override
500 {
501 // The thread pool spawns the worker one step ABOVE the main thread
502 // (prio-1), so a syscall-free compute loop would starve the UI thread
503 // outright; +2 lands it just below main, letting the UI thread always
504 // preempt to sample the hold-B abort.
505 s32 prio = 0;
506 if (R_SUCCEEDED(svcGetThreadPriority(&prio, CUR_THREAD_HANDLE))) {
507 svcSetThreadPriority(CUR_THREAD_HANDLE, prio + 2);
508 }
509 }
510
511 private:
512 int freeSlot(void) const

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected