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

4.2 Task-Dependent Synchronization Functions<br />

Task-dependent synchronization functions achieve synchronization among tasks by direct manipulation<br />

of task states. They include functions for task sleep and wakeup, for canceling wakeup requests, for<br />

forcibly releasing task WAIT state, for changing a task state to SUSPEND state, for delaying execution<br />

of the invoking task, and for disabling task WAIT state.<br />

Wakeup requests for a task are queued. That is, when it is attempted to wake up a task that is not<br />

sleeping, the wakeup request is remembered, and the next time the task is to go to a sleep state (waiting<br />

for wakeup), it does not enter that state. The queuing of task wakeup requests is realized by having the<br />

task keep a task wakeup request queuing count. When the task is started, this count is cleared to 0.<br />

Suspend requests for a task are nested. That is, if it is attempted to suspend a task already in SUSPEND<br />

state (including WAIT-SUSPEND state), the request is remembered, and later when it is attempted to<br />

resume the task in SUSPEND state (including WAIT-SUSPEND state), it is not resumed. The nesting<br />

of suspend requests is realized by having the task keep a suspend request nesting count. When the task<br />

is started, this count is cleared to 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!