Get next task (with higher task ID). * * @param cur Current task * @return Pointer to next task or @c NULL if there are no more tasks. */
| 471 | * @return Pointer to next task or @c NULL if there are no more tasks. |
| 472 | */ |
| 473 | task_t *task_next(task_t *cur) |
| 474 | { |
| 475 | odlink_t *odlink; |
| 476 | |
| 477 | assert(interrupts_disabled()); |
| 478 | assert(irq_spinlock_locked(&tasks_lock)); |
| 479 | |
| 480 | odlink = odict_next(&cur->ltasks, &tasks); |
| 481 | if (odlink == NULL) |
| 482 | return NULL; |
| 483 | |
| 484 | return odict_get_instance(odlink, task_t, ltasks); |
| 485 | } |
| 486 | |
| 487 | /** Get accounting data of given task. |
| 488 | * |
no test coverage detected