MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / SetEffectivePriority

Function SetEffectivePriority

src/dolphin/src/os/OSThread.c:218–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218static OSThread* SetEffectivePriority(OSThread* thread, OSPriority priority)
219{
220 switch (thread->state)
221 {
222 case OS_THREAD_STATE_READY:
223 UnsetRun(thread);
224 thread->priority = priority;
225 SetRun(thread);
226 break;
227 case OS_THREAD_STATE_WAITING:
228 RemoveItem(thread->queue, thread, link);
229 thread->priority = priority;
230 AddPrio(thread->queue, thread, link);
231 if (thread->mutex)
232 {
233 return thread->mutex->thread;
234 }
235 break;
236 case OS_THREAD_STATE_RUNNING:
237 RunQueueHint = TRUE;
238 thread->priority = priority;
239 break;
240 }
241 return NULL;
242}
243
244inline void UpdatePriority(OSThread* thread)
245{

Callers 1

UpdatePriorityFunction · 0.85

Calls 2

UnsetRunFunction · 0.85
SetRunFunction · 0.85

Tested by

no test coverage detected