mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
add check for a not existing thread
This commit is contained in:
parent
afe1015c14
commit
21ffebc197
@ -157,6 +157,11 @@ int msg_reply(msg_t *m, msg_t *reply)
|
||||
|
||||
tcb_t *target = (tcb_t*) sched_threads[m->sender_pid];
|
||||
|
||||
if (!target) {
|
||||
DEBUG("msg_reply(): target \"%" PRIu16 "\" not existing...dropping msg!\n", m->sender_pid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (target->status != STATUS_REPLY_BLOCKED) {
|
||||
DEBUG("%s: msg_reply(): target \"%s\" not waiting for reply.", active_thread->name, target->name);
|
||||
restoreIRQ(state);
|
||||
|
Loading…
Reference in New Issue
Block a user