Everything

pol_sem

ipol_sem

Outline
Acquire semaphore resource (polling).
C format
 ER      pol_sem (ID semid);
 ER      isem_sem (ID semid);
Parameter(s)
I/O
Parameter
Description
I
 ID      semid;
ID number of the semaphore from which resource is acquired.

Explanation
This service call acquires a resource from the semaphore specified by parameter semid (subtracts 0x1 from the semaphore counter).
If a resource could not be acquired from the target semaphore (semaphore counter is set to 0x0) when this service call is issued, the counter manipulation processing is not performed but "E_TMOUT" is returned.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_ID
-18
Invalid ID number.
- semid < 0x0
- semid > Maximum ID number
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
E_NOEXS
-42
Non-existent object.
- Specified semaphore is not registered.
E_TMOUT
-50
Polling failure.
- The resource counter of the target semaphore is 0x0.