SEMAPHORE_CREATE
Purpose
semaphore_create creates
a new semaphore.
Synopsis
#include <types.h>
#include <stub.h>
int semaphore_create(int value,
Capability *semaphore);
Parameters
-
value: the semaphore's initial
value;
-
semaphore: a owner capability for
the created semaphore.
Description
semaphore_create creates a new semaphore
and initializes it to value. The created semaphore is associated
to a new capability that is returned through semaphore.
Return Values
On success, semaphore_create returns
0 and semaphore contains a valid owner capability for the created
semaphore.
On fail, semaphore_create returns a
negative value indicating one of the following errors:
See Also
semaphore_destroy,
semaphore_status, semaphore_p,
semaphore_v
Notes
The semantics of this semaphore implementation
complains to Djikstra specifications and its main use is to synchronize
single task threads.