1
0
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:
Kaspar Schleiser 2021-04-22 18:59:40 +02:00 committed by GitHub
commit 2229e95a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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