1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

core/thread: document thread_add_to_list()

Adding the task to the linked list is graphically commented
This commit is contained in:
DeJusten 2025-03-14 11:00:34 +01:00 committed by Marian Buschsieweke
parent a4ec8e1ebb
commit 2eeb0f7f96
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6

View File

@ -160,6 +160,29 @@ void thread_yield(void)
thread_yield_higher();
}
/*
* Example of insertion operations in the linked list
* thread_add_to_list(list,new_node) //Prio4
* list list new_node
* +------+ +------+ +------+
* | + | -> | + | | 4 + |
* +----|-+ +----|-+ +----|-+
* +-->NULL +-----/\ +-->NULL
* thread_add_to_list(list,higher_node) //Prio2(Higher)
* list new_node higher_node
* +------+ +------+ +------+
* | + | | 4 + | | 2 + |
* +----|-+ +----|-+ +----|-+
* | +-->NULL |
* | /\-------------+
* +----------------/\
* thread_add_to_list(list,lower_node) //Prio6(Lower)
* list new_node lower_node
* +------+ +------+ +------+
* | + | | 4 + | | 6 + |
* +----|-+ +----|-+ +----|-+
* +-----/\ +-----/\ +-->NULL
*/
void thread_add_to_list(list_node_t *list, thread_t *thread)
{
assert(thread->status < STATUS_ON_RUNQUEUE);