a0PSemaphore()

Performs P on a semaphore.


Syntax

a0tError a0PSemaphore(
a0tSemaphore *semaphore );

Arguments

Namerd/wrDescription
semaphore write Semaphore descriptor to operate.

Description

This routine blocks the thread if the counter associated with the semaphore is zero or negative. If the counter is positive, the thread doesn't block. When the thread in unblocked, or if the thread has not blocked, the counter is decremented.


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

a0NewSemaphore() a0DisposeSemaphore() a0TryPSemaphore() a0VSemaphore()