1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sema: deactivate interrupts for queue manipulation

This commit is contained in:
Martine Lenders 2015-11-24 09:43:04 +01:00 committed by Martine Lenders
parent 77547dd399
commit db01af3502

View File

@ -102,11 +102,12 @@ int sema_wait_timed_msg(sema_t *sema, uint64_t timeout, msg_t *msg)
restoreIRQ(old_state);
msg_receive(msg);
old_state = disableIRQ();
if (timeout != 0) {
xtimer_remove(&timeout_timer);
}
priority_queue_remove(&sema->queue, &n);
restoreIRQ(old_state);
if (msg->content.ptr != (void *)sema) {
return -EAGAIN;
}