mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
sys/event: allow calling event_post multiple times
This commit is contained in:
parent
f29714ea83
commit
46888a1eaf
@ -23,11 +23,12 @@ void event_queue_init(event_queue_t *queue)
|
||||
|
||||
void event_post(event_queue_t *queue, event_t *event)
|
||||
{
|
||||
assert(!event->list_node.next);
|
||||
assert(queue->waiter);
|
||||
assert(queue && queue->waiter && event);
|
||||
|
||||
unsigned state = irq_disable();
|
||||
clist_rpush(&queue->event_list, &event->list_node);
|
||||
if (!event->list_node.next) {
|
||||
clist_rpush(&queue->event_list, &event->list_node);
|
||||
}
|
||||
irq_restore(state);
|
||||
|
||||
thread_flags_set(queue->waiter, THREAD_FLAG_EVENT);
|
||||
|
@ -149,6 +149,11 @@ void event_queue_init(event_queue_t *queue);
|
||||
/**
|
||||
* @brief Queue an event
|
||||
*
|
||||
* The given event will be posted on the given @p queue. If the event is already
|
||||
* queued when calling this function, the event will not be touched and remain
|
||||
* in the previous position on the queue. So reposting an event while it is
|
||||
* already on the queue will have no effect.
|
||||
*
|
||||
* @param[in] queue event queue to queue event in
|
||||
* @param[in] event event to queue in event queue
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user