Everything

ref_mtx

Outline
Reference mutex state.
C format
 ER      ref_mtx (ID mtxid, T_RMTX *pk_rmtx);
Parameter(s)
I/O
Parameter
Description
I
 ID      mtxid;
ID number of the mutex.
O
 T_RMTX  *pk_rmtx;
Pointer to the packet returning the mutex state.

[Mutex state packet: T_RMTX]
 typedef struct  t_rmtx {
     ID      htskid;         /*Existence of locked mutex*/
     ID      wtskid;         /*Existence of waiting task*/
 } T_RMTX;

Explanation
This service call stores the detailed information of the mutex specified by parameter mtxid (existence of locked mutexes, waiting tasks, etc.) into the area specified by parameter pk_rmtx.
- htskid
Stores whether a task that is locking a mutex exists.
TSK_NONE: No applicable task
Value: ID number of the task locking the mutex
- wtskid
Stores whether a task is queued to the mutex wait queue.
TSK_NONE: No applicable task
Value: ID number of the task at the head of the wait queue
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_PAR
-17
parameter error.
- pk_rmtx == NULL
E_ID
-18
Invalid ID number.
- mtxid < 0
- mtxid > VTMAX_MTX
E_CTX
-25
Context error.
- This service call was issued from a non-task.
- This service call was issued in the CPU locked state.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
E_MACV
-26
Memory access violation.
- The operand-write access to the area indicated by pk_rmtx has not been permitted to the invoking task
E_NOEXS
-42
Non-existent object.
- The mutex specified by mtxid does not exist.