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 63<br />

tk dly tsk<br />

Delay Task<br />

[C Language Interface]<br />

ER ercd = tk_dly_tsk ( RELTIM dlytim ) ;<br />

[Parameters]<br />

RELTIM dlytim Delay time<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E NOMEM<br />

E PAR<br />

E CTX<br />

E RLWAI<br />

E DISWAI<br />

Normal completion<br />

Insufficient memory<br />

Parameter error (dlytim is invalid)<br />

Context error (issued from task-independent portion or in dispatch disabled state)<br />

Wait state released (tk rel wai received in wait state)<br />

Wait released by wait disabled state<br />

[Description]<br />

Temporarily stops execution of the invoking task and waits for time dlytim to elapse. The state while<br />

the task waits for the delay time to elapse is a WAIT state and is subject to release by tk rel wai.<br />

If the task issuing this system call goes to SUSPEND state or WAIT-SUSPEND state while it is waiting<br />

for the delay time to elapse, the time continues to be counted in the SUSPEND state.<br />

The time base for dlytim (time unit) is the same as that for system time (= 1 ms).<br />

[Additional Notes]<br />

This system call differs from tk slp tsk in that normal completion, not an error code, is returned when<br />

the delay time elapses and tk dly tsk terminates. Moreover, the wait is not released even if tk wup tsk<br />

is executed during the delay time. The only way to terminate tk dly tsk before the delay time elapses<br />

is by calling tk ter tsk or tk rel wai.<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!