Definition:
|
integer status = task_status(integer task_id)
|
Description:
|
Return the status of a task. Status values are 1 (active), 0 (suspended), and -1 (task does not exist)
|
Comments:
|
A task might want to know the status of one or more other tasks when deciding whether to proceed with some processing.
A -1 value could indicate a task that never existed, or a task that terminated naturally or was killed.
|
Example:
|
integer s
s = task_status(tid)
if s=1 then
puts(1, "ACTIVE\n")
elsif s=0 then
puts(1, "SUSPENDED\n")
else
puts(1, "DOES NOT EXIST!!\n")
end if
|
See Also:
|
task_list,
task_create,
task_schedule,
task_suspend
|