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

Function __DSP_insert_task

src/dolphin/src/dsp/dsp_task.c:354–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354void __DSP_insert_task(DSPTaskInfo* task)
355{
356 DSPTaskInfo* temp;
357
358 if (__DSP_first_task == NULL)
359 {
360 __DSP_first_task = __DSP_last_task = __DSP_curr_task = task;
361 task->next = task->prev = NULL;
362 }
363 else
364 {
365 temp = __DSP_first_task;
366
367 while (temp)
368 {
369 if (task->priority < temp->priority)
370 {
371 task->prev = temp->prev;
372 temp->prev = task;
373 task->next = temp;
374 if (task->prev == NULL)
375 {
376 __DSP_first_task = task;
377 }
378 else
379 {
380 (task->prev)->next = task;
381 }
382 break;
383 }
384 temp = temp->next;
385 }
386
387 if (temp == NULL)
388 {
389 __DSP_last_task->next = task;
390 task->next = NULL;
391 task->prev = __DSP_last_task;
392 __DSP_last_task = task;
393 }
394 }
395}
396
397void __DSP_remove_task(DSPTaskInfo* task)
398{

Callers 1

DSPAddTaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected