06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

pSOS+ <strong>System</strong> <strong>Calls</strong> t_restart<br />

t_restart Forces a task to start over regardless of its current state.<br />

#include <br />

unsigned long t_restart(<br />

unsigned long tid, /* task identifier */<br />

unsigned long targs[4] /* startup arguments */<br />

)<br />

Description<br />

Arguments<br />

This system call forces a task to resume execution at its original start address<br />

regardless of its current state or place of execution. If the task was blocked, the<br />

pSOS+ kernel forcibly unblocks it. The task's priority and stacks are set to the<br />

original values that t_create() specified. Its start address and execution mode are<br />

reset to the original values established by t_start(). Any pending events, signals,<br />

or armed timers are cleared.<br />

The t_restart() call accepts a new set of up to four arguments, which, among<br />

other things, can be used by the task to distinguish between the initial startup and<br />

subsequent restarts.<br />

Because it can unconditionally unblock a task and alter its flow of execution,<br />

t_restart() is useful for forcing a task to execute cleanup code on its own behalf<br />

after which the task can delete itself by executing t_delete().<br />

The calling task does not have to be the creator (or parent) of the task it restarts.<br />

However, a task must be restarted from the node on which it was created.<br />

tid Specifies the task to restart. When tid equals 0, the calling<br />

task restarts itself.<br />

targs Specifies up to four long words of input that are passed to<br />

the restarted task.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 1-149<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!