mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 18:13:49 +01:00
Merge pull request #6428 from OTAkeys/fix/xtimer_mutex_infinite_loop
xtimer: fix mutex unlocking in _mutex_timeout
This commit is contained in:
commit
9a38c1085c
@ -233,8 +233,12 @@ static void _mutex_timeout(void *arg)
|
|||||||
mutex_thread_t *mt = (mutex_thread_t *)arg;
|
mutex_thread_t *mt = (mutex_thread_t *)arg;
|
||||||
|
|
||||||
mt->timeout = 1;
|
mt->timeout = 1;
|
||||||
|
list_node_t *node = list_remove(&mt->mutex->queue,
|
||||||
|
(list_node_t *)&mt->thread->rq_entry);
|
||||||
|
if ((node != NULL) && (mt->mutex->queue.next == NULL)) {
|
||||||
|
mt->mutex->queue.next = MUTEX_LOCKED;
|
||||||
|
}
|
||||||
sched_set_status(mt->thread, STATUS_PENDING);
|
sched_set_status(mt->thread, STATUS_PENDING);
|
||||||
list_remove(&mt->mutex->queue, (list_node_t *)&mt->thread->rq_entry);
|
|
||||||
thread_yield_higher();
|
thread_yield_higher();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user