Tries to perform a P on a semaphore.
a0tError a0TryPSemaphore( | | | |
| a0tSemaphore | *semaphore | |
| int | *succeed );
| |
Name | rd/wr | Description |
semaphore | write | Semaphore descriptor to operate. |
succeed | write | Flag true if a P was possible. |
This routine tests if the counter associated with the semaphore is zero or negative and returns the result in succeed. The thread doesn't block, but when succeed is true the counter is decremented, as if a real P operation had succeeded.
Error Code | Description |
A0Err...Some error occurred. | |
A0ErrOkSuccessful completion. | |
a0NewSemaphore() a0DisposeSemaphore() a0PSemaphore() a0VSemaphore()