Download RadiSys ARTIC960 Programmer`s Reference

Transcript
ReleaseSem—Release a Semaphore
ReleaseSem—Release a Semaphore
This service makes a semaphore available to the next process waiting for it.
Functional Prototype
RIC_ULONG ReleaseSem (RIC_SEMHANDLE SemHandle,
RIC_ULONG
Reserved);
Parameters
SemHandle Input. Handle of semaphore to increment.
Reserved
Input. Reserved parameter (must be 0).
Returns
RC_SUCCESS
RC_INVALID_HANDLE
RC_INVALID_RESERVED_PARM
RC_SEM_NOT_OWNED
Remarks
The next process waiting for the semaphore is posted if this is the only semaphore for
which it is waiting. If no processes are waiting, the semaphore count is incremented.
A mutual exclusion semaphore cannot be released with this service twice by the same
process, unless it does a RequestSem in between. In addition, a mutual exclusion
semaphore cannot be released by a process other than the one that last requested it.
54
ARTIC960 Programmer’s Reference