![]() |
ChibiOS/RT Architecture - Reference Manual - Guides |
|
All the functions present in this module, while public, are not an OS API and should not be directly used in the user applications code.
Data Structures | |
| struct | ThreadsQueue |
| Generic threads bidirectional linked list header and element. More... | |
| struct | ThreadsList |
| Generic threads single link list, it works like a stack. More... | |
Defines | |
| #define | queue_init(tqp) ((tqp)->p_next = (tqp)->p_prev = (Thread *)(tqp)); |
| Threads queue initialization. | |
| #define | list_init(tlp) ((tlp)->p_next = (Thread *)(tlp)) |
| Threads list initialization. | |
| #define | isempty(p) ((p)->p_next == (Thread *)(p)) |
Evaluates to TRUE if the specified threads queue or list is empty. | |
| #define | notempty(p) ((p)->p_next != (Thread *)(p)) |
Evaluates to TRUE if the specified threads queue or list is not empty. | |
| #define | _THREADSQUEUE_DATA(name) {(Thread *)&name, (Thread *)&name} |
| Data part of a static threads queue initializer. | |
| #define | THREADSQUEUE_DECL(name) ThreadsQueue name = _THREADSQUEUE_DATA(name) |
| Static threads queue initializer. | |
Functions | |
| void | prio_insert (Thread *tp, ThreadsQueue *tqp) |
| Inserts a thread into a priority ordered queue. | |
| void | queue_insert (Thread *tp, ThreadsQueue *tqp) |
| Inserts a Thread into a queue. | |
| Thread * | fifo_remove (ThreadsQueue *tqp) |
| Removes the first-out Thread from a queue and returns it. | |
| Thread * | lifo_remove (ThreadsQueue *tqp) |
| Removes the last-out Thread from a queue and returns it. | |
| Thread * | dequeue (Thread *tp) |
| Removes a Thread from a queue and returns it. | |
| void | list_insert (Thread *tp, ThreadsList *tlp) |
| Pushes a Thread on top of a stack list. | |
| Thread * | list_remove (ThreadsList *tlp) |
| Pops a Thread from the top of a stack list and returns it. | |
| #define queue_init | ( | tqp | ) | ((tqp)->p_next = (tqp)->p_prev = (Thread *)(tqp)); |
Threads queue initialization.
Definition at line 46 of file chlists.h.
Referenced by chCondInit(), chMtxInit(), chSemInit(), init_thread(), and scheduler_init().
| #define list_init | ( | tlp | ) | ((tlp)->p_next = (Thread *)(tlp)) |
| #define isempty | ( | p | ) | ((p)->p_next == (Thread *)(p)) |
| #define notempty | ( | p | ) | ((p)->p_next != (Thread *)(p)) |
Evaluates to TRUE if the specified threads queue or list is not empty.
Definition at line 63 of file chlists.h.
Referenced by chCondSignal(), chCondSignalI(), and chThdExit().
| #define THREADSQUEUE_DECL | ( | name | ) | ThreadsQueue name = _THREADSQUEUE_DATA(name) |
Static threads queue initializer.
Statically initialized threads queues require no explicit initialization using queue_init().
| [in] | name | the name of the threads queue variable |
| void prio_insert | ( | Thread * | tp, | |
| ThreadsQueue * | tqp | |||
| ) |
Inserts a thread into a priority ordered queue.
| [in] | tp | the pointer to the thread to be inserted in the list |
| [in] | tqp | the pointer to the threads list header |
Definition at line 49 of file chlists.c.
References Thread::p_next, Thread::p_prev, and Thread::p_prio.
Referenced by chCondWaitS(), chCondWaitTimeoutS(), and chMtxLockS().
| void queue_insert | ( | Thread * | tp, | |
| ThreadsQueue * | tqp | |||
| ) |
Inserts a Thread into a queue.
| [in] | tp | the pointer to the thread to be inserted in the list |
| [in] | tqp | the pointer to the threads list header |
Definition at line 71 of file chlists.c.
References Thread::p_next, ThreadsQueue::p_prev, and Thread::p_prev.
| Thread * fifo_remove | ( | ThreadsQueue * | tqp | ) |
Removes the first-out Thread from a queue and returns it.
| [in] | tqp | the pointer to the threads list header |
Definition at line 87 of file chlists.c.
References Thread::p_next, and ThreadsQueue::p_next.
Referenced by chCondBroadcastI(), chCondSignal(), chCondSignalI(), chMsgRelease(), chMtxUnlock(), chMtxUnlockAll(), chMtxUnlockS(), chSchDoRescheduleI(), chSchGoSleepS(), chSemSignal(), chSemSignalI(), and chSemSignalWait().
| Thread * lifo_remove | ( | ThreadsQueue * | tqp | ) |
Removes the last-out Thread from a queue and returns it.
| [in] | tqp | the pointer to the threads list header |
Definition at line 103 of file chlists.c.
References Thread::p_prev, and ThreadsQueue::p_prev.
Referenced by chSemResetI().
Removes a Thread from a queue and returns it.
The thread is removed from the queue regardless of its relative position and regardless the used insertion method.
| [in] | tp | the pointer to the thread to be removed from the queue |
Definition at line 119 of file chlists.c.
References Thread::p_next, and Thread::p_prev.
Referenced by chMtxLockS().
| void list_insert | ( | Thread * | tp, | |
| ThreadsList * | tlp | |||
| ) |
Pushes a Thread on top of a stack list.
| [in] | tp | the pointer to the thread to be inserted in the list |
| [in] | tlp | the pointer to the threads list header |
Definition at line 133 of file chlists.c.
References ThreadsList::p_next, and Thread::p_next.
Referenced by chThdWait().
| Thread * list_remove | ( | ThreadsList * | tlp | ) |
Pops a Thread from the top of a stack list and returns it.
| [in] | tlp | the pointer to the threads list header |
Definition at line 147 of file chlists.c.
References Thread::p_next, and ThreadsList::p_next.
Referenced by chThdExit().
1.7.1