Go to the documentation of this file.
31 #if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__)
71 #define __SEMAPHORE_DATA(name, n) {__CH_QUEUE_DATA(name.queue), n}
82 #define SEMAPHORE_DECL(name, n) semaphore_t name = __SEMAPHORE_DATA(name, n)
void chSemAddCounterI(semaphore_t *sp, cnt_t n)
Adds the specified value to the semaphore counter.
#define MSG_RESET
Wakeup caused by a reset condition.
void chSemSignal(semaphore_t *sp)
Performs a signal operation on a semaphore.
static cnt_t chSemGetCounterI(const semaphore_t *sp)
Returns the semaphore counter current value.
msg_t chSemWait(semaphore_t *sp)
Performs a wait operation on a semaphore.
msg_t chSemWaitS(semaphore_t *sp)
Performs a wait operation on a semaphore.
struct ch_semaphore semaphore_t
Semaphore structure.
void chSemResetWithMessageI(semaphore_t *sp, cnt_t n, msg_t msg)
Performs a reset operation on the semaphore.
void chSemObjectInit(semaphore_t *sp, cnt_t n)
Initializes a semaphore with the specified counter value.
static void chSemFastSignalI(semaphore_t *sp)
Increases the semaphore counter.
Structure representing a generic bidirectional linked list header and element.
ch_queue_t queue
Queue of the threads sleeping on this semaphore.
cnt_t cnt
The semaphore counter.
uint64_t sysinterval_t
Type of time interval.
static void chSemReset(semaphore_t *sp, cnt_t n)
Performs a reset operation on the semaphore.
static void chSemFastWaitI(semaphore_t *sp)
Decreases the semaphore counter.
msg_t chSemWaitTimeout(semaphore_t *sp, sysinterval_t timeout)
Performs a wait operation on a semaphore with timeout specification.
void chSemResetWithMessage(semaphore_t *sp, cnt_t n, msg_t msg)
Performs a reset operation on the semaphore.
msg_t chSemSignalWait(semaphore_t *sps, semaphore_t *spw)
Performs atomic signal and wait operations on two semaphores.
static void chSemResetI(semaphore_t *sp, cnt_t n)
Performs a reset operation on the semaphore.
msg_t chSemWaitTimeoutS(semaphore_t *sp, sysinterval_t timeout)
Performs a wait operation on a semaphore with timeout specification.
void chSemSignalI(semaphore_t *sp)
Performs a signal operation on a semaphore.