
CHAPTER 13 SERVICE CALLS
User’s Manual U14833EJ2V0UM
181
For an event flag with the TA_WMUL attribute, the order in which waiting tasks are registered to the queue is
determined by the attribute of the event flag. If the attribute is TA_TFIFO, the tasks wait on an FIFO basis. If the
attribute is TA_TPRI, the tasks wait according to their priorities. When set_flg is issued, however, two or more tasks
may be released from the waiting state all at once because it is checked whether the condition under which the task is
released from the waiting state is satisfied or not. Therefore, the first task in the queue is not always released from the
waiting state first. If two or more tasks are released from the waiting state and if the event flag has the attribute
TA_CLR, the event flag is cleared as soon as the first task has been released from the waiting state. Consequently,
the bit pattern (0) is compared with the waiting bit pattern, and the processing to release the task from the waiting
state is completed as soon as the bit pattern has been compared.
Tasks placed in the waiting state due to wai_flg are released from waiting by one of the following occurrences.
1.
(i)set_flg is issued and the event flag satisfies the condition (E_OK).
2.
(i)rel_wai is issued and the task is forcibly released from the waiting state (E_RLWAI).
3.
del_flg is issued and the event flag is deleted (E_DLT).
[Differences from
μ
ITRON3.0]
1.
2.
3.
The order of the parameters has been changed.
The type of the bit pattern of the event flag has been changed from UINT to FLGPTN.
The type of the waiting mode wfmode has been changed from UINT to MODE.
FLGPTN and MODE are types newly defined for
μ
ITRON4.0.
[Return values]
Symbol
Value
Meaning
E_OK
0
Normal termination
E_RSFN
10
wai_flg is not included in the system
E_PAR
17
The parameter is illegal
The waiting bit pattern is 0 (waiptn = 0)
The waiting mode specification is illegal
E_ID
18
The event flag ID number is outside the range
(flgid
≤
0, maximum event flag count < flgid)
E_CTX
25
wai_flg was issued from a non-task context
wai_flg was issued in the CPU lock state
wai_flg was issued in the dispatch disabled state
E_OBJ
41
A waiting task already exists (when the attribute is TA_WSGL)
E_NOEXS
42
The target event flag does not exist
E_RLWAI
49
The task has been forcibly released from the waiting state by (i)rel_wai
E_DLT
51
The event flag is deleted while the task is waiting