Skip to content
Snippets Groups Projects
Commit ef01efc3 authored by Joakim Nohlgård's avatar Joakim Nohlgård
Browse files

core/msg: Set THREAD_FLAG_MSG_WAITING when queueing messages

parent acfa7271
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#include "msg.h" #include "msg.h"
#include "list.h" #include "list.h"
#include "thread.h" #include "thread.h"
#if MODULE_CORE_THREAD_FLAGS
#include "thread_flags.h"
#endif
#include "irq.h" #include "irq.h"
#include "cib.h" #include "cib.h"
...@@ -47,6 +50,10 @@ static int queue_msg(thread_t *target, const msg_t *m) ...@@ -47,6 +50,10 @@ static int queue_msg(thread_t *target, const msg_t *m)
DEBUG("queue_msg(): queuing message\n"); DEBUG("queue_msg(): queuing message\n");
msg_t *dest = &target->msg_array[n]; msg_t *dest = &target->msg_array[n];
*dest = *m; *dest = *m;
#if MODULE_CORE_THREAD_FLAGS
target->flags |= THREAD_FLAG_MSG_WAITING;
thread_flags_wake(target);
#endif
return 1; return 1;
} }
...@@ -137,6 +144,11 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, unsigned sta ...@@ -137,6 +144,11 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, unsigned sta
thread_add_to_list(&(target->msg_waiters), me); thread_add_to_list(&(target->msg_waiters), me);
#if MODULE_CORE_THREAD_FLAGS
target->flags |= THREAD_FLAG_MSG_WAITING;
thread_flags_wake(target);
#endif
irq_restore(state); irq_restore(state);
thread_yield_higher(); thread_yield_higher();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment