[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changing task mode
- Date: Fri, 14 Aug 2009 11:55:28 +0200
- From: leonard.bise at syderal.ch (Leonard Bise)
- Subject: Changing task mode
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://www.rtems.org/pipermail/rtems-users/attachments/20090814/afe7d883/attachment.html