mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
core: msg: yield after queueing of a message if REPLY_BLOCKED
When setting the running task reply_blocked, it is implicitly removed from the runqueue. But if queueing of a msg is actually successful, the thread exits msg_send without yielding, continuing to run even if it's not supposed to. Nice example of why multiple function exit points lead to weird errors...
This commit is contained in:
parent
8d07b131db
commit
622d473eb3
@ -78,6 +78,9 @@ int msg_send(msg_t *m, unsigned int target_pid, bool block)
|
||||
if (target->msg_array && queue_msg(target, m)) {
|
||||
DEBUG("msg_send() %s:%i: Target %i has a msg_queue. Queueing message.\n", __FILE__, __LINE__, target_pid);
|
||||
eINT();
|
||||
if (active_thread->status == STATUS_REPLY_BLOCKED) {
|
||||
thread_yield();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user