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.

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

tk del mbf<br />

Delete Message Buffer<br />

[C Language Interface]<br />

ER ercd = tk_del_mbf ( ID mbfid ) ;<br />

[Parameters]<br />

ID mbfid Message buffer ID<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

Normal completion<br />

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

Object does not exist (the message buffer designated in mbfid does not exist)<br />

[Description]<br />

Deletes the message buffer designated in mbfid.<br />

Issuing this system call releases the corresponding message buffer and control block memory space, as<br />

well as the message buffer space.<br />

This system call completes normally even if there were tasks queued in the message buffer for message<br />

receipt or message sending, but error code E DLT is returned to the tasks in WAIT state. If there are<br />

messages left in the message buffer when it is deleted, the message buffer is deleted anyway. No error<br />

code is returned and the messages are discarded.<br />

Task A<br />

(1)<br />

tk snd mbf(mbfid)<br />

Task B<br />

(2)<br />

tk rcv mbf(mbfid)<br />

Message send wait (TTW SMBF) if wait entered at (1)<br />

Message receive wait (TTW RMBF) if wait entered at (2)<br />

Figure 4.4: Synchronous Communication Using Message Buffer of bufsz = 0<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!