mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
SQUASHME: do it right
This commit is contained in:
parent
d8a5ee1ec8
commit
2a859c78cd
@ -58,8 +58,7 @@ int msg_send(msg_t *m, unsigned int target_pid, bool block)
|
||||
return msg_send_int(m, target_pid);
|
||||
}
|
||||
|
||||
m->sender_pid = sched_active_pid;
|
||||
if (m->sender_pid == target_pid) {
|
||||
if ((unsigned int)sched_active_pid == target_pid) {
|
||||
return msg_send_to_self(m);
|
||||
}
|
||||
|
||||
@ -67,6 +66,8 @@ int msg_send(msg_t *m, unsigned int target_pid, bool block)
|
||||
|
||||
tcb_t *target = (tcb_t*) sched_threads[target_pid];
|
||||
|
||||
m->sender_pid = sched_active_pid;
|
||||
|
||||
if (target == NULL) {
|
||||
DEBUG("msg_send(): target thread does not exist\n");
|
||||
eINT();
|
||||
@ -134,6 +135,7 @@ int msg_send_to_self(msg_t *m)
|
||||
{
|
||||
unsigned int state = disableIRQ();
|
||||
|
||||
m->sender_pid = sched_active_pid;
|
||||
int res = queue_msg((tcb_t *) sched_active_thread, m);
|
||||
|
||||
restoreIRQ(state);
|
||||
|
Loading…
Reference in New Issue
Block a user