Changing task mode

Leonard Bise leonard.bise at syderal.ch
Fri Aug 14 09:55:28 UTC 2009


Hi all,

I have a task performing some actions, that I would like to not be done at 
the same time by another task. I know it would certainly be better to use 
semaphores but this code was not writtten by me and it would be 
complicated to change it.

To do so I chose to modify the task mode of my current task executing the 
actions that should not be done concuratively like so.

rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode);

If I understand it correctly this new mode should keep other tasks from 
being called until I reactivate the preemption, is it correct?
So for the time where my current task is set as not preemptive I have no 
risk that the code I'm currently executing will be done by another task.

I hope someone can clarify this for me. 

Thanks in advance, Léo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20090814/afe7d883/attachment.html>


More information about the users mailing list