31 #if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__) 71 #define _SEMAPHORE_DATA(name, n) {_THREADS_QUEUE_DATA(name.queue), n} 82 #define SEMAPHORE_DECL(name, n) semaphore_t name = _SEMAPHORE_DATA(name, n) msg_t chSemWait(semaphore_t *sp)
Performs a wait operation on a semaphore.
cnt_t cnt
The semaphore counter.
void chSemAddCounterI(semaphore_t *sp, cnt_t n)
Adds the specified value to the semaphore counter.
uint64_t sysinterval_t
Type of time interval.
msg_t chSemWaitTimeoutS(semaphore_t *sp, sysinterval_t timeout)
Performs a wait operation on a semaphore with timeout specification.
msg_t chSemWaitS(semaphore_t *sp)
Performs a wait operation on a semaphore.
void chSemSignal(semaphore_t *sp)
Performs a signal operation on a semaphore.
static void chSemFastWaitI(semaphore_t *sp)
Decreases the semaphore counter.
Generic threads bidirectional linked list header and element.
struct ch_semaphore semaphore_t
Semaphore structure.
static void chSemFastSignalI(semaphore_t *sp)
Increases the semaphore counter.
void chSemReset(semaphore_t *sp, cnt_t n)
Performs a reset operation on the semaphore.
threads_queue_t queue
Queue of the threads sleeping on this semaphore.
msg_t chSemSignalWait(semaphore_t *sps, semaphore_t *spw)
Performs atomic signal and wait operations on two semaphores.
void chSemObjectInit(semaphore_t *sp, cnt_t n)
Initializes a semaphore with the specified counter value.
msg_t chSemWaitTimeout(semaphore_t *sp, sysinterval_t timeout)
Performs a wait operation on a semaphore with timeout specification.
void chDbgCheckClassI(void)
I-class functions context check.
static cnt_t chSemGetCounterI(const semaphore_t *sp)
Returns the semaphore counter current value.
void chSemSignalI(semaphore_t *sp)
Performs a signal operation on a semaphore.
void chSemResetI(semaphore_t *sp, cnt_t n)
Performs a reset operation on the semaphore.