del_mtx

Outline

Delete mutex.

C format

 ER      del_mtx (ID mtxid);
Parameter(s)

I/O

Parameter

Description

I

 ID      mtxid;
ID number of the mutex.



Explanation

This service call can be called from tasks that belong to Trusted Domain.

This service call deletes the mutex indicated by mtxid.

When either of task locks the target mutex, the lock by the task is cancelled. As a result, the current task priority of the task is returned to the base priority when there is no mutex being locked by the task. The task is not notified that the mutex has been deleted. If an attempt is later made to unlock the mutex by using unl_mtx, an error E_NOEXS is returned.

When there are waiting tasks for the target mutex by using loc_mtx or tloc_mtx, this service call cancels the WAITING state of the tasks and returns E_DLT as a return value of the loc_mtx or tloc_mtx.



Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_ID

-18

Invalid ID number.

- mtxid < 0

- mtxid > VTMAX_MTX

E_CTX

-25

Context error.

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

- This service call 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.

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

E_OACV

-27

Object access violation.

- The invoking task does not belong to trusted domain.

E_NOEXS

-42

Non-existent object.

- The mutex specified by mtxid does not exist.