30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.2. TASK-DEPENDENT SYNCHRONIZATION FUNCTIONS 61<br />

tk rsm tsk<br />

tk frsm tsk<br />

Resume Task<br />

Force Resume Task<br />

[C Language Interface]<br />

ER ercd = tk_rsm_tsk ( ID tskid ) ;<br />

ER ercd = tk_frsm_tsk ( ID tskid ) ;<br />

[Parameters]<br />

ID tskid Task ID<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E OBJ<br />

Normal completion<br />

Invalid ID number (tskid is invalid or cannot be used)<br />

Object does not exist (the task designated in tskid does not exist)<br />

Invalid object state (the designated task is not in SUSPEND state (including when this<br />

system call designates the invoking task or a task in DORMANT state))<br />

[Description]<br />

Releases the SUSPEND state of the task designated in tskid.<br />

If the target task was earlier put in SUSPEND state by the tk sus tsk system call, this system call<br />

releases that SUSPEND state and resumes the task execution.<br />

When the target task is in a combined WAIT state and SUSPEND state (WAIT-SUSPEND state),<br />

executing tk rsm tsk releases only the SUSPEND state, putting the task in WAIT state.<br />

This system call cannot be issued for the invoking task. If the invoking task is designated, error code<br />

E OBJ is returned.<br />

Executing tk rsm tsk one time clears only one nested suspend request (suscnt). If tk sus tsk was<br />

issued more than once for the target task (suscnt ≥ 2), the target task remains in SUSPEND state<br />

even after tk rsm tsk is executed. When tk frsm tsk is issued, on the other hand, all suspend requests<br />

are released (suscnt is cleared to 0) even if tk sus tsk was issued more than once (suscnt ≥ 2). The<br />

SUSPEND state is always cleared, and unless the task was in WAIT-SUSPEND state its execution<br />

resumes.<br />

[Additional Notes]<br />

After a task in RUN state or READY state is put in SUSPEND state by tk sus tsk and then resumed<br />

by tk rsm tsk or tk frsm tsk, the task has the lowest precedence among tasks of the same priority.<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!