Go to the documentation of this file.
31 #if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__)
64 #if (CH_CFG_USE_MUTEXES_RECURSIVE == TRUE) || defined(__DOXYGEN__)
80 #if (CH_CFG_USE_MUTEXES_RECURSIVE == TRUE) || defined(__DOXYGEN__)
81 #define __MUTEX_DATA(name) {__CH_QUEUE_DATA(name.queue), NULL, NULL, 0}
83 #define __MUTEX_DATA(name) {__CH_QUEUE_DATA(name.queue), NULL, NULL}
93 #define MUTEX_DECL(name) mutex_t name = __MUTEX_DATA(name)
cnt_t cnt
Mutex recursion counter.
static thread_t * chMtxGetOwnerI(mutex_t *mp)
Returns the mutex owner thread.
static bool ch_queue_notempty(const ch_queue_t *qp)
Evaluates to true if the specified queue is not empty.
void chMtxLock(mutex_t *mp)
Locks the specified mutex.
void chMtxUnlockAll(void)
Unlocks all mutexes owned by the invoking thread.
bool chMtxTryLock(mutex_t *mp)
Tries to lock a mutex.
bool chMtxTryLockS(mutex_t *mp)
Tries to lock a mutex.
Structure representing a thread.
static mutex_t * chMtxGetNextMutexX(void)
Returns the next mutex in the mutexes stack of the current thread.
void chMtxObjectInit(mutex_t *mp)
Initializes s mutex_t structure.
Structure representing a generic bidirectional linked list header and element.
thread_t * owner
Owner thread_t pointer or NULL.
void chMtxUnlockAllS(void)
Unlocks all mutexes owned by the invoking thread.
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.
void chMtxLockS(mutex_t *mp)
Locks the specified mutex.
ch_queue_t queue
Queue of the threads sleeping on this mutex.
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.