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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

36 CHAPTER 4. T-KERNEL/OS FUNCTIONS<br />

[Additional Notes]<br />

When a task is terminated by tk ter tsk, the resources acquired by the task up to that time (memory<br />

blocks, semaphores, etc.) are not automatically freed. The user is responsible for releasing such resources<br />

before the task terminates.<br />

As a rule, the task priority and other information included in the TCB are reset when the task returns<br />

to DORMANT state. If, for example, the task priority is changed by tk chg pri and later terminated<br />

by tk ter tsk, the task priority reverts to the startup priority (itskpri) designated when the task was<br />

started. It does not keep the task priority in effect at the time tk ter tsk was executed.<br />

Forcible termination of another task is intended for use only by a debugger or a few other tasks closely<br />

related to the OS. As a rule, this system call is not to be used by ordinary applications or middleware,<br />

for the following reason.<br />

Forced termination occurs regardless of the running state of the target task.<br />

If, for example, a task were forcibly terminated while the task was calling a middleware function, the<br />

task would terminate right while the middleware was executing. If such a situation were allowed, normal<br />

operation of the middleware could not be guaranteed.<br />

This is an example of how task termination cannot be allowed when the task status (what it is executing)<br />

is unknown. Ordinary applications therefore must not use the forcible termination function.<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!