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

Method lowerPriority

3ds/source/script/scripthost.cpp:338–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336 }
337
338 void lowerPriority(void) override
339 {
340 // The thread pool spawns the worker one step ABOVE the main thread
341 // (prio-1), so a syscall-free compute loop would starve the UI thread
342 // outright; +2 lands it just below main, letting the UI thread always
343 // preempt to sample the hold-B abort.
344 s32 prio = 0;
345 if (R_SUCCEEDED(svcGetThreadPriority(&prio, CUR_THREAD_HANDLE))) {
346 svcSetThreadPriority(CUR_THREAD_HANDLE, prio + 2);
347 }
348 }
349
350 private:
351 int freeSlot(void) const

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected