-
tloc_mtx
-
Lock mutex (with timeout).
ER tloc_mtx (ID mtxid, TMO tmout);
|
|
|
|
ID mtxid;
|
ID number of the mutex to be locked.
|
|
TMO tmout;
|
Specified timeout (unit:millisecond).
TMO_FEVR: Waiting forever.
Value: Specified timeout.
|
This service call locks the mutex specified by parameter
mtxid.
If the target mutex could not be locked (another task has been locked) when this service call is issued, this service call queues the invoking task to the target mutex wait queue and moves it from the RUNNING state to the WAITING state with timeout (mutex wait state).
The WAITING state for a mutex is cancelled in the following cases, and then moved to the READY state.
WAITING State for a Mutex Cancel Operation
|
|
The locked state of the target mutex was cancelled as a result of issuing unl_mtx.
|
|
The locked state of the target mutex was cancelled as a result of issuing ext_tsk.
|
|
The locked state of the target mutex was cancelled as a result of issuing ter_tsk.
|
|
Forced release from waiting (accept rel_wai while waiting).
|
|
Forced release from waiting (accept irel_wai while waiting).
|
|
Polling failure or timeout.
|
|
Note 1 Invoking tasks are queued to the target mutex wait queue in the order defined during configuration (FIFO order or priority order).
Note 2 In the RI850V4, E_ILUSE is returned if this service call is re-issued for the mutex that has been locked by the invoking task (multiple-locking of mutex).
Note 3 TMO_FEVR is specified for wait time
tmout, processing equivalent to
loc_mtx will be executed. When TMO_POL is specified, processing equivalent to
ploc_mtx will be executed.
|
|
|
|
|
|
|
|
|
|
|
- mtxid > Maximum ID number
|
|
|
- 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 dispatching disabled state.
|
|
|
Illegal service call use.
- Multiple locking of a mutex.
|
|
|
- Specified mutex is not registered.
|
|
|
Forced release from the WAITING state.
|
|
|
- Polling failure or timeout.
|