BeRTOS
|
Mutually exclusive semaphores. More...
Process synchronization services | |
void | sem_init (struct Semaphore *s) |
Initialize a Semaphore structure. | |
bool | sem_attempt (struct Semaphore *s) |
Attempt to lock a semaphore without waiting. | |
void | sem_obtain (struct Semaphore *s) |
Lock a semaphore. | |
void | sem_release (struct Semaphore *s) |
Release a lock on a previously locked semaphore. |
Mutually exclusive semaphores.
Shared locking not supported in this implementation.
bool sem_attempt | ( | struct Semaphore * | s | ) |
Attempt to lock a semaphore without waiting.
void sem_obtain | ( | struct Semaphore * | s | ) |
Lock a semaphore.
If the semaphore is already owned by another process, the caller process will be enqueued into the waiting list and sleep until the semaphore is available.
void sem_release | ( | struct Semaphore * | s | ) |
Release a lock on a previously locked semaphore.
If the nesting count of the semaphore reaches zero, the next process waiting for it will be awaken.