Go to the documentation of this file.
74 #if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__)
109 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
146 if (mp->
owner != NULL) {
147 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
153 if (mp->
owner == currtp) {
178 #if (CH_CFG_USE_CONDVARS == TRUE) || \
179 ((CH_CFG_USE_SEMAPHORES == TRUE) && \
180 (CH_CFG_USE_SEMAPHORES_PRIORITY == TRUE)) || \
181 ((CH_CFG_USE_MESSAGES == TRUE) && \
182 (CH_CFG_USE_MESSAGES_PRIORITY == TRUE))
183 #if CH_CFG_USE_CONDVARS == TRUE
186 #if (CH_CFG_USE_SEMAPHORES == TRUE) && \
187 (CH_CFG_USE_SEMAPHORES_PRIORITY == TRUE)
190 #if (CH_CFG_USE_MESSAGES == TRUE) && (CH_CFG_USE_MESSAGES_PRIORITY == TRUE)
199 #if CH_DBG_ENABLE_ASSERTS == TRUE
222 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
228 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
290 if (mp->
owner != NULL) {
291 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
295 if (mp->
owner == currtp) {
302 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
336 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
357 while (lmp != NULL) {
374 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
392 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
422 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
443 while (lmp != NULL) {
460 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
472 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
499 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
509 #if CH_CFG_USE_MUTEXES_RECURSIVE == TRUE
514 }
while (currtp->
mtxlist != NULL);
#define CH_STATE_READY
Waiting on the ready list.
ch_queue_t * next
Next in the list/queue.
cnt_t cnt
Mutex recursion counter.
thread_t * chSchReadyI(thread_t *tp)
Inserts a thread in the Ready List placing it behind its peers.
tprio_t realprio
Thread's own, non-inherited, priority.
ch_priority_queue_t pqueue
Threads ordered queues element.
#define CH_STATE_WTMTX
On a mutex.
#define chDbgAssert(c, r)
Condition assertion.
struct ch_mutex * mtxlist
List of the mutexes owned by this thread.
#define CH_STATE_WTCOND
On a cond.variable.
void chMtxLock(mutex_t *mp)
Locks the specified mutex.
void chMtxUnlockAll(void)
Unlocks all mutexes owned by the invoking thread.
#define chDbgCheck(c)
Function parameters check.
struct ch_mutex * wtmtxp
Pointer to a generic mutex object.
bool chMtxTryLock(mutex_t *mp)
Tries to lock a mutex.
bool chMtxTryLockS(mutex_t *mp)
Tries to lock a mutex.
#define CH_STATE_SNDMSGQ
Sending a message, in queue.
Structure representing a thread.
void chSchGoSleepS(tstate_t newstate)
Puts the current thread to sleep into the specified state.
#define CH_STATE_CURRENT
Currently running.
union ch_thread::@0 hdr
Shared list headers.
static ch_queue_t * ch_queue_fifo_remove(ch_queue_t *qp)
Removes the first-out element from a queue and returns it.
void chMtxObjectInit(mutex_t *mp)
Initializes s mutex_t structure.
union ch_thread::@1 u
State-specific fields.
thread_t * owner
Owner thread_t pointer or NULL.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
void chMtxUnlockAllS(void)
Unlocks all mutexes owned by the invoking thread.
static void ch_queue_init(ch_queue_t *qp)
Queue initialization.
void ch_sch_prio_insert(ch_queue_t *qp, ch_queue_t *tp)
Inserts a thread into a priority ordered queue.
void chMtxUnlock(mutex_t *mp)
Unlocks the specified mutex.
mutex_t * next
Next mutex_t into an owner-list or NULL.
void chMtxUnlockS(mutex_t *mp)
Unlocks the specified mutex.
ch_queue_t queue
Threads queues element.
tstate_t state
Current thread state.
void chMtxLockS(mutex_t *mp)
Locks the specified mutex.
static ch_queue_t * ch_queue_dequeue(ch_queue_t *p)
Removes an element from a queue and returns it.
ch_queue_t queue
Queue of the threads sleeping on this mutex.
tprio_t prio
Priority of this element.
#define chSysUnlock()
Leaves the kernel lock state.
#define CH_STATE_WTSEM
On a semaphore.
static bool chMtxQueueNotEmptyS(mutex_t *mp)
Returns true if the mutex queue contains at least a waiting thread.
#define chThdGetSelfX()
Returns a pointer to the current thread_t.
#define chSysLock()
Enters the kernel lock state.