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

Method lowerPriority

3ds/source/script/scripthost.cpp:534–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532 }
533
534 void lowerPriority(void) override
535 {
536 // The thread pool spawns the worker one step ABOVE the main thread
537 // (prio-1), so a syscall-free compute loop would starve the UI thread
538 // outright; +2 lands it just below main, letting the UI thread always
539 // preempt to sample the hold-B abort.
540 s32 prio = 0;
541 if (R_SUCCEEDED(svcGetThreadPriority(&prio, CUR_THREAD_HANDLE))) {
542 svcSetThreadPriority(CUR_THREAD_HANDLE, prio + 2);
543 }
544 }
545
546 private:
547 int freeSlot(void) const

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected