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) {_THREADS_QUEUE_DATA(name.queue), NULL, NULL, 0} 83 #define _MUTEX_DATA(name) {_THREADS_QUEUE_DATA(name.queue), NULL, NULL} 93 #define MUTEX_DECL(name) mutex_t name = _MUTEX_DATA(name) bool chMtxTryLock(mutex_t *mp)
Tries to lock a mutex.
void chDbgCheckClassS(void)
S-class functions context check.
threads_queue_t queue
Queue of the threads sleeping on this mutex.
void chMtxUnlockS(mutex_t *mp)
Unlocks the specified mutex.
struct ch_mutex * mtxlist
List of the mutexes owned by this thread.
Generic threads bidirectional linked list header and element.
void chMtxUnlockAllS(void)
Unlocks all mutexes owned by the invoking thread.
thread_t * owner
Owner thread_t pointer or NULL.
static mutex_t * chMtxGetNextMutexS(void)
Returns the next mutex in the mutexes stack of the current thread.
mutex_t * next
Next mutex_t into an owner-list or NULL.
void chMtxLock(mutex_t *mp)
Locks the specified mutex.
bool chMtxTryLockS(mutex_t *mp)
Tries to lock a mutex.
static bool chMtxQueueNotEmptyS(mutex_t *mp)
Returns true if the mutex queue contains at least a waiting thread.
static thread_t * chThdGetSelfX(void)
Returns a pointer to the current thread_t.
static bool queue_notempty(const threads_queue_t *tqp)
Evaluates to true if the specified threads queue is not empty.
void chMtxObjectInit(mutex_t *mp)
Initializes s mutex_t structure.
cnt_t cnt
Mutex recursion counter.
void chMtxUnlock(mutex_t *mp)
Unlocks the specified mutex.
void chMtxUnlockAll(void)
Unlocks all mutexes owned by the invoking thread.
void chMtxLockS(mutex_t *mp)
Locks the specified mutex.
Structure representing a thread.