[Bug 1817] Variable _Thread_Heir is not protected against interrupts
bugzilla-daemon at rtems.org
bugzilla-daemon at rtems.org
Thu Sep 22 13:48:20 UTC 2011
https://www.rtems.org/bugzilla/show_bug.cgi?id=1817
--- Comment #8 from Helder Silva <silvah15 at gmail.com> 2011-09-22 08:48:19 CDT ---
Yes, you are right, if you consider *a=b as atomic instruction, the
_ISR_Disable
*a = b;
_ISR_Enable
… is unnecessary. Please just keep in mind the final assembly code, which is
not atomic.
In the patch there is one case more or less similar with the above:
+ _ISR_Disable(level);
_Thread_Heir = (Thread_Control *) sched_info->thread;
+ _ISR_Enable(level);
The others are always more complex situations like for example:
+ _ISR_Disable(level);
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
@@ -73,4 +76,5 @@
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
}
+ _ISR_Enable(level);
And
+ _ISR_Disable(level);
_Thread_Heir = (Thread_Control *) _Chain_First(
(Chain_Control *) _Scheduler.information
);
+ _ISR_Enable(level);
In my idea these should be maintained.
The last update should be also removed since it is the initialization of the
Thread Initialization Handler.
--
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the bugs
mailing list