From a67694a8c086878beb30a4e32271e3bfd6d88a85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= <joakim.nohlgard@eistec.se>
Date: Thu, 31 Aug 2017 22:49:29 +0200
Subject: [PATCH] core: thread_flags: Set sched_status_switch_request after
 waking a waiting thread

---
 core/thread_flags.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/thread_flags.c b/core/thread_flags.c
index 281a592306..314b77a29e 100644
--- a/core/thread_flags.c
+++ b/core/thread_flags.c
@@ -112,8 +112,9 @@ inline int __attribute__((always_inline)) thread_flags_wake(thread_t *thread)
     }
 
     if (wakeup) {
-        DEBUG("_thread_flags_wake(): wakeing up pid %"PRIkernel_pid"\n", thread->pid);
-        sched_set_status(thread, STATUS_RUNNING);
+        DEBUG("_thread_flags_wake(): waking up pid %"PRIkernel_pid"\n", thread->pid);
+        sched_set_status(thread, STATUS_PENDING);
+        sched_context_switch_request = 1;
     }
 
     return wakeup;
-- 
GitLab