1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/xtimer
Pieter Willemsen f3b13cf90c xtimer: check in timeout callback if thread blocked on mutex
Prevent a possible race condition when _mutex_timeout fires just after the
mutex was locked but before the xtimer was removed

The flow

int xtimer_mutex_lock_timeout(mutex_t *mutex, uint64_t timeout) {
   ...
    mutex_lock(mutex);
    /* mutex locked */
    /* _mutex_timeout fires and tries to remove thread from mutex queue */
    /* DEBUG: simulate callback call between lock and remove */
    xtimer_spin(xtimer_ticks_from_usec(timeout*2));
    xtimer_remove(&t);
    ...
}
2019-11-27 14:48:51 +01:00
..
Makefile sys: xtimer: introduce new timer subsystem 2015-08-25 13:20:35 +02:00
xtimer_core.c xtimer: timer & target overflow, hang resolved. 2018-11-01 16:48:20 +01:00
xtimer.c xtimer: check in timeout callback if thread blocked on mutex 2019-11-27 14:48:51 +01:00