|
ChibiOS/RT
2.5.1 |
|
All the functions present in this module, while public, are not OS APIs 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... | |
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. | |
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. | |
| 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 44 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 67 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 84 of file chlists.c.
References Thread::p_next, and ThreadsQueue::p_next.
Referenced by chCondBroadcastI(), chCondSignal(), chCondSignalI(), chIQPutI(), chIQResetI(), chMsgWait(), chMtxUnlock(), chMtxUnlockAll(), chMtxUnlockS(), chOQGetI(), chOQResetI(), chSchDoRescheduleAhead(), chSchDoRescheduleBehind(), chSchGoSleepS(), chSemAddCounterI(), 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 101 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 118 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 148 of file chlists.c.
References Thread::p_next, and ThreadsList::p_next.
Referenced by chThdExitS().
| #define queue_init | ( | tqp | ) | ((tqp)->p_next = (tqp)->p_prev = (Thread *)(tqp)); |
Threads queue initialization.
Definition at line 42 of file chlists.h.
Referenced by _scheduler_init(), _thread_init(), chCondInit(), chIQInit(), chMtxInit(), chOQInit(), and chSemInit().
| #define list_init | ( | tlp | ) | ((tlp)->p_next = (Thread *)(tlp)) |
Threads list initialization.
Definition at line 49 of file chlists.h.
Referenced by _thread_init().
| #define isempty | ( | p | ) | ((p)->p_next == (Thread *)(p)) |
Evaluates to TRUE if the specified threads queue or list is empty.
Definition at line 57 of file chlists.h.
Referenced by chSemAddCounterI(), chSemResetI(), chSemSignal(), chSemSignalI(), chSemSignalWait(), chSemWaitS(), and chSemWaitTimeoutS().
| #define notempty | ( | p | ) | ((p)->p_next != (Thread *)(p)) |
Evaluates to TRUE if the specified threads queue or list is not empty.
Definition at line 65 of file chlists.h.
Referenced by chCondSignal(), chCondSignalI(), chIQPutI(), chIQResetI(), chOQGetI(), chOQResetI(), chSemAddCounterI(), chSemResetI(), chSemSignal(), chSemSignalI(), chSemSignalWait(), chSemWaitS(), chSemWaitTimeoutS(), and chThdExitS().
| #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 |