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
..
2019-10-08 20:58:52 +02:00
2018-10-18 13:37:21 +02:00
2019-05-16 12:01:36 +02:00
2019-09-09 20:27:16 +02:00
2019-09-13 11:37:44 +02:00
2018-08-24 18:14:03 +02:00
2019-06-05 17:10:26 +02:00
2018-10-03 10:44:14 +02:00
2019-04-12 15:51:15 +02:00