native: add thread_yield_higher misuse warning

This commit is contained in:
Ludwig Ortmann 2014-11-28 12:13:45 +01:00 committed by Ludwig Knüpfer
parent 83886d61c7
commit 237340b3e3

View File

@ -185,6 +185,9 @@ void thread_yield_higher(void)
if (_native_in_isr == 0) { if (_native_in_isr == 0) {
ucontext_t *ctx = (ucontext_t *)(sched_active_thread->sp); ucontext_t *ctx = (ucontext_t *)(sched_active_thread->sp);
_native_in_isr = 1; _native_in_isr = 1;
if (!native_interrupts_enabled) {
warnx("thread_yield_higher: interrupts are disabled - this should not be");
}
irq_disable(); irq_disable();
native_isr_context.uc_stack.ss_sp = __isr_stack; native_isr_context.uc_stack.ss_sp = __isr_stack;
native_isr_context.uc_stack.ss_size = SIGSTKSZ; native_isr_context.uc_stack.ss_size = SIGSTKSZ;