tk_wup_tsk

Wakeup Task

[C Language Interface]

ER ercd = tk_wup_tsk ( ID tskid ) ;

[Parameters]

ID	tskid	Task ID

[Return Parameters]

ER	ercd	Error code

[Error Codes]

E_OK     Normal completion
E_ID     Invalid ID number (tskid is invalid or cannot be used)
E_NOEXS  Object does not exist (the task specified in tskid does not exist)
E_OBJ    Invalid object state (called for the invoking task or for a task in DORMANT state)
E_QOVR   Queuing or nesting overflow (too many queued wakeup requests in wupcnt)

[Description]

If the task specified in tskid was put in WAIT state by tk_slp_tsk, this system call releases the WAIT state.

This system call cannot be called for the invoking task. If the invoking task is specified, error code E_OBJ is returned.

If the target task has not called tk_slp_tsk and is not in WAIT state, the wakeup request by tk_wup_tsk is queued. That is, the calling of tk_wup_tsk for the target task is recorded; when tk_slp_tsk is called after that, the task does not go to WAIT state. This is what is meant by queuing of wakeup requests.

The queuing of wakeup requests works as follows:

Each task keeps a wakeup request queuing count (wupcnt) in its TCB. Its initial value (when tk_sta_tsk is executed) is 0. When tk_wup_tsk is issued for a task not sleeping (not in WAIT state), the count is incremented by 1; but each time tk_slp_tsk is executed, the count is decremented by 1. When tk_slp_tsk is executed for a task whose wakeup queuing count is 0, the queuing count does not go become negative, but rather the task goes to WAIT state.

It is always possible to queue tk_wup_tsk once (wupcnt=1). The maximum value of wake-up request queueing count (wupcnt) is implementation-defined and specifies an appropriate value greater than or equal to one. That is, an error does not occur if tk_wup_tsk is issued once to a task in non-wait state, however it is implementation-defined concerning whether second or subsequent issuances of tk_wup_tsk cause an error or not.

When calling tk_wup_tsk causes wupcnt to exceed the maximum allowed value, error code E_QOVR is returned.

Comments

Click here to Post a Comment