Sturk 1.0.2
Publish-subscribe C implementation.
|
Semaphore. More...
Go to the source code of this file.
Typedefs | |
typedef struct StSem | StSem |
Semaphore. | |
Functions | |
StSem * | st_sem_create (StBits args) |
Create a semaphore. | |
void | st_sem_destroy (StSem *sem) |
Destroy a semaphore. | |
void | st_sem_wait (StSem *sem) |
Wait on semaphore. | |
bool | st_sem_trywait (StSem *sem) |
Decrement the semaphore counter if it is greater than 0. | |
void | st_sem_post (StSem *sem) |
Increment the semaphore counter. | |
Semaphore.
Create a semaphore.
[in] | args | The configuration arguments. |
void st_sem_destroy | ( | StSem * | sem | ) |
Destroy a semaphore.
[in,out] | sem | The semaphore. |
void st_sem_post | ( | StSem * | sem | ) |
Increment the semaphore counter.
[in,out] | sem | The semaphore. |
bool st_sem_trywait | ( | StSem * | sem | ) |
Decrement the semaphore counter if it is greater than 0.
[in,out] | sem | The semaphore. |
Does not block the calling thread.
void st_sem_wait | ( | StSem * | sem | ) |
Wait on semaphore.
Blocks the calling thread until the semaphore counter is 0. Decrement the counter.
[in,out] | sem | The semaphore. |