 |
Xyris
0.5
|
Go to the documentation of this file.
15 #define COMPARE_EXCHANGE(curVal, failure_memorder) __atomic_compare_exchange_n( \
33 uint32_t curVal =
count();
47 uint32_t curVal =
count();
62 uint32_t curVal =
count();
75 __atomic_fetch_add(&
m_count, 1, __ATOMIC_RELEASE);
84 __atomic_load(&
m_count, &ret, __ATOMIC_ACQUIRE);
bool timeWait(const uint32_t *usec)
Wait on the semaphore for a set duration of time.
Semaphore(uint32_t val, bool share, const char *name=nullptr)
Initializes a semaphore struct using the values defined. Semaphores are used in order to maintain mut...
bool post()
Post to the semaphore.
uint32_t count()
Atomically get the semaphore's current counter value.
#define COMPARE_EXCHANGE(curVal, failure_memorder)
struct task_sync m_taskSync
void tasks_sync_unblock(struct task_sync *ts)
bool tryWait()
Check if the semaphore is available. If unavailable, return immediately, otherwise wait on the semaph...
void tasks_sync_block(struct task_sync *ts)
bool wait()
Wait for the semaphore to become available.