The Semaphore Subsystem implements the classic synchronization primitive.
More...
Detailed Description
The Semaphore Subsystem implements the classic synchronization primitive.
Function Documentation
syscall semcount |
( |
semaphore |
sem | ) |
|
Return a semaphore's count.
- Parameters:
-
- Returns:
- count from semtab entry on success, SYSERR on failure
semaphore semcreate |
( |
int |
count | ) |
|
Create and initialize a semaphore, returning its ID.
- Parameters:
-
count | resources available. |
- Returns:
- new semaphore ID on success, SYSERR on failure
syscall semfree |
( |
semaphore |
sem | ) |
|
Deallocate a semaphore.
Reset the semaphore count, releasing any threads in the waiting queue. Deallocate entry in global semaphore table.
- Parameters:
-
- Returns:
- OK on success, SYSERR on failure
syscall signal |
( |
semaphore |
sem | ) |
|
signal a semaphore, releasing one waiting thread
- Parameters:
-
- Returns:
- OK on success, SYSERR on failure
syscall signaln |
( |
semaphore |
sem, |
|
|
int |
count |
|
) |
| |
Signal a semaphore n times, releasing n waiting threads.
- Parameters:
-
sem | target semaphore |
count | number of times to signal |
- Returns:
- OK on success, SYSERR on failure
syscall wait |
( |
semaphore |
sem | ) |
|
Make current process wait on a semaphore.
- Parameters:
-
- Returns:
- OK on success, SYSERR on failure