twai_sem
ER twai_sem (ID semid, TMO tmout);
This service call acquires a resource from the semaphore specified by parameter semid (subtracts 0x1 from the semaphore counter).
If no resources are acquired from the target semaphore when service call is issued this (no available resources exist), this service call does not acquire resources but queues the invoking task to the target semaphore wait queue and moves it from the RUNNING state to the WAITING state with timeout (resource acquisition wait state).
The WAITING state for a semaphore resource is cancelled in the following cases, and then moved to the READY state.
Note 1 Invoking tasks are queued to the target semaphore wait queue in the order defined during configuration (FIFO order or priority order).
Note 2 TMO_FEVR is specified for wait time tmout, processing equivalent to wai_sem will be executed. When TMO_POL is specified, processing equivalent to pol_sem /ipol_sem will be executed.