mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #16374 from seeseemelk/master
xtimer: Fix race condition in xtimer_msg_receive_timeout
This commit is contained in:
commit
2229e95a3b
@ -135,12 +135,12 @@ static void _setup_timer_msg(msg_t *m, xtimer_t *t)
|
||||
static int _msg_wait(msg_t *m, msg_t *tmsg, xtimer_t *t)
|
||||
{
|
||||
msg_receive(m);
|
||||
xtimer_remove(t);
|
||||
if (m->type == MSG_XTIMER && m->content.ptr == tmsg) {
|
||||
/* we hit the timeout */
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
xtimer_remove(t);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user