From 0c87335a4590d24a137d44f65212c71131d8a7a9 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 27 Sep 2021 20:35:00 +0200 Subject: [PATCH] core/msg: yield after thread_flags_wake() in queue_msg() --- core/msg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/msg.c b/core/msg.c index 7bfb40f697..6921626c4d 100644 --- a/core/msg.c +++ b/core/msg.c @@ -119,7 +119,10 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, " has a msg_queue. Queueing message.\n", RIOT_FILE_RELATIVE, __LINE__, target_pid); irq_restore(state); - if (me->status == STATUS_REPLY_BLOCKED) { + if (me->status == STATUS_REPLY_BLOCKED + || (IS_USED(MODULE_CORE_THREAD_FLAGS) && + sched_context_switch_request) + ) { thread_yield_higher(); } return 1;