1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

xtimer: fix race condition in xtimer_msg_receive_timeout

This commit is contained in:
Sebastiaan de Schaetzen 2021-04-22 16:29:09 +02:00
parent e5a0c2c400
commit dee65e7ec6

View File

@ -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;
}
}