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.

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

tk sig tev<br />

Signal Task Event<br />

[C Language Interface]<br />

ER ercd = tk_sig_tev ( ID tskid, INT tskevt ) ;<br />

[Parameters]<br />

ID tskid Task ID<br />

INT tskevt Task event number (1 to 8)<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E OBJ<br />

E PAR<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 (called for a task in DORMANT state)<br />

Parameter error (tskevt is invalid)<br />

[Description]<br />

Sends the task event designated in tskevt to the task designated in tskid. There are eight task event<br />

types stored for each task, designated by numbers 1 to 8.<br />

The task event send count is not saved, only whether the event occurs or not.<br />

The invoking task can be designated by setting tskid = TSK SELF = 0. Note, however, that when a<br />

system call is issued from a task-independent portion and tskid = TSK SELF = 0 is designated, error<br />

code E ID is returned.<br />

[Additional Notes]<br />

The task event function is used for synchronization much like tk slp tsk and tk wup tsk, but differs<br />

from the use of those system calls in the following ways.<br />

• The wakeup request (task event) count is not kept.<br />

• Wakeup requests can be classified by the eight event types.<br />

Using the same event type for synchronization in two or more places in the same task would cause<br />

confusion. Event type allocation should be clearly defined. The task event function is intended for<br />

use in middleware, and as a rule should not be used in ordinary applications. Use of tk slp tsk and<br />

tk wup tsk is recommended for applications.<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!