Hi,
I tried to use xtimer_mutex_lock_timeout but if I try to lock the mutex again when the timeout has expired, the mutex_lock is stuck in an infinite loop.
By changing the _mutex_timeout function as follow, it solves the issue:
static void _mutex_timeout(void *arg)
{
mutex_thread_t *mt = (mutex_thread_t *)arg;
mt->timeout = 1;
list_remove(&mt->mutex->queue, (list_node_t *)&mt->thread->rq_entry);
if (mt->mutex->queue.next == NULL) {
mt->mutex->queue.next = MUTEX_LOCKED;
}
sched_set_status(mt->thread, STATUS_PENDING);
thread_yield_higher();
}
Hi,
I tried to use xtimer_mutex_lock_timeout but if I try to lock the mutex again when the timeout has expired, the mutex_lock is stuck in an infinite loop.
By changing the
_mutex_timeoutfunction as follow, it solves the issue: