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 chThdGetSelfX()
Returns a pointer to the current thread_t.
#define chSysUnlock()
Leaves the kernel lock state.
#define chSysLock()
Enters the kernel lock state.
#define chSchGoSleepS(newstate)
Puts the current thread to sleep into the specified state.
#define chDbgAssert(c, r)
Condition assertion.
#define chDbgCheck(c)
Function parameters check.
#define chDbgCheckClassS()
void chMtxUnlock(mutex_t *mp)
Unlocks the specified mutex.
void chMtxUnlockAllS(void)
Unlocks all mutexes owned by the invoking thread.
bool chMtxTryLockS(mutex_t *mp)
Tries to lock a mutex.
void chMtxUnlockAll(void)
Unlocks all mutexes owned by the invoking thread.
static bool chMtxQueueNotEmptyS(mutex_t *mp)
Returns true if the mutex queue contains at least a waiting thread.
struct ch_mutex mutex_t
Type of a mutex structure.
bool chMtxTryLock(mutex_t *mp)
Tries to lock a mutex.
void chMtxLockS(mutex_t *mp)
Locks the specified mutex.
void chMtxUnlockS(mutex_t *mp)
Unlocks the specified mutex.
void chMtxObjectInit(mutex_t *mp)
Initializes s mutex_t structure.
void chMtxLock(mutex_t *mp)
Locks the specified mutex.
static void ch_queue_init(ch_queue_t *qp)
Queue initialization.
static ch_queue_t * ch_queue_dequeue(ch_queue_t *p)
Removes an element from a queue and returns it.
static ch_queue_t * ch_queue_fifo_remove(ch_queue_t *qp)
Removes the first-out element from a queue and returns it.
#define threadref(p)
Safe cast of a queue pointer to a thread pointer.
struct ch_thread thread_t
Type of a thread structure.
#define CH_STATE_READY
Waiting on the ready list.
#define CH_STATE_CURRENT
Currently running.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
#define CH_STATE_WTCOND
On a cond.variable.
thread_t * chSchReadyI(thread_t *tp)
Inserts a thread in the Ready List placing it behind its peers.
void ch_sch_prio_insert(ch_queue_t *qp, ch_queue_t *tp)
Inserts a thread into a priority ordered queue.
#define CH_STATE_WTMTX
On a mutex.
#define CH_STATE_SNDMSGQ
Sending a message, in queue.
#define CH_STATE_WTSEM
On a semaphore.
cnt_t cnt
Mutex recursion counter.
thread_t * owner
Owner thread_t pointer or NULL.
mutex_t * next
Next mutex_t into an owner-list or NULL.
ch_queue_t queue
Queue of the threads sleeping on this mutex.
tprio_t prio
Priority of this element.
ch_queue_t * next
Next in the list/queue.
ch_queue_t queue
Threads queues element.
union ch_thread::@065317322233202114332352372014266163076165303275 hdr
Shared list headers.
struct ch_mutex * wtmtxp
Pointer to a generic mutex object.
tprio_t realprio
Thread's own, non-inherited, priority.
struct ch_mutex * mtxlist
List of the mutexes owned by this thread.
tstate_t state
Current thread state.
ch_priority_queue_t pqueue
Threads ordered queues element.
union ch_thread::@250330312022121344252011223135034045240103044261 u
State-specific fields.