diff --git a/core/msg.c b/core/msg.c index a46875f16e8b354042d693d894dbfa6961aae587..86ee0dd287ae61ee6e4a42d633c85ab0412fc97f 100644 --- a/core/msg.c +++ b/core/msg.c @@ -330,6 +330,7 @@ static int _msg_receive(msg_t *m, int block) thread_yield_higher(); /* sender copied message */ + assert(sched_active_thread->status != STATUS_RECEIVE_BLOCKED); } else { irq_restore(state); diff --git a/cpu/native/native_cpu.c b/cpu/native/native_cpu.c index 2629e55df0670a18307205bccbae51e0b353615f..655562565e77d57e1a6a5c13e123d74f7a85aaf6 100644 --- a/cpu/native/native_cpu.c +++ b/cpu/native/native_cpu.c @@ -208,6 +208,8 @@ void isr_thread_yield(void) void thread_yield_higher(void) { + sched_context_switch_request = 1; + if (_native_in_isr == 0) { ucontext_t *ctx = (ucontext_t *)(sched_active_thread->sp); _native_in_isr = 1; @@ -224,9 +226,6 @@ void thread_yield_higher(void) } irq_enable(); } - else { - sched_context_switch_request = 1; - } } void native_cpu_init(void)