Problem when suspending a task.

Leon Pollak leonp at plris.com
Thu Jan 7 10:26:13 UTC 2010


On Thursday January 7 2010, Nick Thomas wrote:
> I presume that it is safe for task 'X' to suspend task 'Y' when 'Y' is
> asleep, or waiting on a message Q.
> And possibly when waiting on a semaphore.
> So, is it possible to obtain the state of the task to be suspended, and if
> it's in one of those states then I can suspend it.
> I see that the task state is listed in the monitor 'task' command, but this
> code is in RTEMS, and I can't see an obvious rtems_task_xxx API call to
> obtain this info. Is there one?
Yes, this may be a way, although too complicated.

May be you will consider the simpler decision: when you want to suspend from 
task A task B set some flag variable in A, while B will test this flag and 
suspend itself when not in a dangerous region.

BR
-- 
Leon



More information about the users mailing list