tk_wai_tev
Wait Task Event
INT tevptn = tk_wai_tev ( INT waiptn, TMO tmout ) ;
INT waiptn Task event pattern
TMO tmout Timeout
INT tevptn Task event status when wait released
or Error Code
E_OK Normal completion
E_PAR Parameter error (waiptn or tmout is invalid)
E_RLWAI Wait state released (tk_rel_wai received in wait state)
E_DISWAI Wait released by wait disabled state
E_TMOUT Polling failed or timeout
E_CTX Context error (issued from task-independent portion or in dispatch disabled state)
Waits for the occurrence of one of the task events specified in waiptn. When the wait is released by a task event, the task events specified in waiptn are cleared (raised task event &= ~waiptn).
The task event status occurring when the wait was released (the state before clearing) is passed in the return code (tevptn).
The parameters waiptn and tevptn consist of logical OR values of the bits for each task event in the form 1 << (task event number .-1).
A maximum wait time (timeout) can be set in tmout. If the tmout time elapses before the wait release condition is met (tk_sig_tev is not executed), the system call terminates, returning timeout error code E_TMOUT. Only positive values can be set in tmout. The time base for tmout (time unit) is the same as that for system time (= 1 ms). When TMO_POL =0 is setin tmout, this means 0 was specified as the timeout value, and E_TMOUT is returned without entering WAIT state even if no task event occurs. When TMO_FEVR =(.-1) is set in tmout, this means in.nity was specified as the timeout value, and the task continues to wait for a task event without timing out.

Comments