1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Fix the race condition when an interruption occured at the beginning

of thread_yield(), i.e.: just after SR(R2) was pushed but before
the rest of the suspended thread's context was pushed!
This commit is contained in:
Kévin Roussel 2014-08-26 16:50:45 +02:00
parent 3df5a2745f
commit 4421de003b

View File

@ -22,12 +22,12 @@ char __isr_stack[MSP430_ISR_STACK_SIZE];
of its execution, in inlined __restore_context() sub-function */
__attribute__((naked)) void thread_yield(void)
{
__save_context();
/* disable IRQ, remembering if they are
to be reactivated after context switch */
unsigned int irqen = disableIRQ();
__save_context();
/* have sched_active_thread point to the next thread */
sched_run();