a0NewSemaphore()

Creates a semaphore.


Syntax

a0tError a0NewSemaphore(
a0tSemaphore *semaphore,
int initial );

Arguments

Namerd/wrDescription
semaphore write Semaphore descriptor to fill.
initial read Initial semaphore counter value.

Description

This routine creates a semaphore descriptor and initialize the semaphore counter with the integer value initial. This value may be any integer value.

On return of this function, the variable pointed by semaphore contains a semaphore descriptor.


Return Values

If an error condition occurs, it returns the error code, otherwise it returns A0ErrOk. Possible values are as follows:
Error CodeDescription
A0Err...Some error occurred.
A0ErrOkSuccessful completion.

See Also

a0PSemaphore() a0VSemaphore() a0TryPSemaphore() a0DisposeSemaphore()