sig_sem

isig_sem

Outline

Release semaphore resource.

C format

 ER      sig_sem (ID semid);
 ER      isig_sem (ID semid);
Parameter(s)

I/O

Parameter

Description

I

 ID      semid;
ID number of the semaphore.



Explanation

These service calls releases the resource to the semaphore specified by parameter semid (adds 1 to the semaphore counter).

If a task is queued in the wait queue of the target semaphore when this service call is issued, the counter manipulation processing is not performed but the resource is passed to the relevant task (first task of wait queue).

As a result, the relevant task is unlinked from the wait queue and is moved from the WAITING state (WAITING state for a semaphore resource) to the READY state, or from the WAITING-SUSPENDED state to the SUSPENDED state.

Note With the RI600PX, the maximum possible number of semaphore resources is defined at semaphore creation. If the number of resources exceeds the maximum resource count, this service call therefore does not release the acquired resources (addition to the semaphore counter value) but returns E_QOVR.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_ID

-18

Invalid ID number.

- semid < 0

- semid > VTMAX_SEM

E_CTX

-25

Context error.

- This service call was issued in the CPU locked state.

- The isig_sem was issued from task.

- The sig_sem was issued from non-task.

- This service call was issued in the status PSW.IPL > kernel interrupt mask level.

E_MACV

-26

Memory access violation. (only for sig_sem)

- Stack pointer points out of user stack for invoking task.

E_NOEXS

-42

Non-existent object.

- The semaphore specified by semid does not exist.

E_QOVR

-43

Queuing overflow.

- Resource count exceeded the maximum resource count.