Get first task (task with lowest ID). * * @return Pointer to first task or @c NULL if there are none. */
| 452 | * @return Pointer to first task or @c NULL if there are none. |
| 453 | */ |
| 454 | task_t *task_first(void) |
| 455 | { |
| 456 | odlink_t *odlink; |
| 457 | |
| 458 | assert(interrupts_disabled()); |
| 459 | assert(irq_spinlock_locked(&tasks_lock)); |
| 460 | |
| 461 | odlink = odict_first(&tasks); |
| 462 | if (odlink == NULL) |
| 463 | return NULL; |
| 464 | |
| 465 | return odict_get_instance(odlink, task_t, ltasks); |
| 466 | } |
| 467 | |
| 468 | /** Get next task (with higher task ID). |
| 469 | * |
no test coverage detected