12 #ifndef INCLUDE_DISTORTOS_C_API_SEMAPHORE_H_ 13 #define INCLUDE_DISTORTOS_C_API_SEMAPHORE_H_ 69 #define DISTORTOS_SEMAPHORE_INITIALIZER(self, value, maxValue) \ 70 {ESTD_INTRUSIVELIST_INITIALIZER((self).blockedList), (value) < (maxValue) ? (value) : (maxValue), (maxValue)} 83 #define DISTORTOS_SEMAPHORE_CONSTRUCT_1(name, value, maxValue) \ 84 struct distortos_Semaphore name = DISTORTOS_SEMAPHORE_INITIALIZER(name, value, maxValue) 95 #define DISTORTOS_SEMAPHORE_CONSTRUCT(name, value) DISTORTOS_SEMAPHORE_CONSTRUCT_1(name, value, UINT_MAX) C-API for estd::IntrusiveList.
unsigned int maxValue
Definition: Semaphore.h:51
C-API equivalent of estd::IntrusiveList.
Definition: IntrusiveList.h:32
struct estd_IntrusiveList blockedList
Definition: Semaphore.h:45
int distortos_Semaphore_tryWait(struct distortos_Semaphore *semaphore)
C-API equivalent of distortos::Semaphore::tryWait()
Definition: C-API-Semaphore.cpp:79
int distortos_Semaphore_post(struct distortos_Semaphore *semaphore)
C-API equivalent of distortos::Semaphore::post()
Definition: C-API-Semaphore.cpp:70
unsigned int value
Definition: Semaphore.h:48
int distortos_Semaphore_destruct(struct distortos_Semaphore *semaphore)
C-API equivalent of distortos::Semaphore's destructor.
Definition: C-API-Semaphore.cpp:40
int distortos_Semaphore_tryWaitUntil(struct distortos_Semaphore *semaphore, int64_t timePoint)
C-API equivalent of distortos::Semaphore::tryWaitUntil()
Definition: C-API-Semaphore.cpp:97
int distortos_Semaphore_wait(struct distortos_Semaphore *semaphore)
C-API equivalent of distortos::Semaphore::wait()
Definition: C-API-Semaphore.cpp:106
int distortos_Semaphore_getValue(const struct distortos_Semaphore *semaphore, unsigned int *value)
C-API equivalent of distortos::Semaphore::getValue()
Definition: C-API-Semaphore.cpp:60
int distortos_Semaphore_getMaxValue(const struct distortos_Semaphore *semaphore, unsigned int *maxValue)
C-API equivalent of distortos::Semaphore::getMaxValue()
Definition: C-API-Semaphore.cpp:50
C-API equivalent of distortos::Semaphore.
Definition: Semaphore.h:42
int distortos_Semaphore_construct_1(struct distortos_Semaphore *semaphore, unsigned int value, unsigned int maxValue)
C-API equivalent of distortos::Semaphore's constructor.
Definition: C-API-Semaphore.cpp:30
int distortos_Semaphore_tryWaitFor(struct distortos_Semaphore *semaphore, int64_t duration)
C-API equivalent of distortos::Semaphore::tryWaitFor()
Definition: C-API-Semaphore.cpp:88
static int distortos_Semaphore_construct(struct distortos_Semaphore *const semaphore, const unsigned int value)
C-API equivalent of distortos::Semaphore's constructor, maxValue == UINT_MAX.
Definition: Semaphore.h:133