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

19 Commits

Author SHA1 Message Date
Fabian Hüßler
3047bef039 sys/event: add event_is_queued() 2023-10-06 18:21:34 +02:00
Leandro Lanzieri
b3b76bf6f3
sys/event: ensure that a queue has a waiter before waiting for flags
Document and enforce that a queue has a waiter (i.e. it is claimed)
before waiting for thread flags.
2022-04-14 17:10:24 +02:00
Leandro Lanzieri
d3ee32fe97
sys/event: add queue initialization pre-cond to event_post
Document that a queue should have been initialized before posting events
to it.
2022-04-14 17:08:42 +02:00
Hauke Petersen
91859fc261 sys/event: add event_wait_timeout_ztimer() 2021-03-31 10:11:29 +02:00
Marian Buschsieweke
cf05b39da5
sys/event: add missing precondition to doc 2021-03-04 12:21:07 +01:00
Marian Buschsieweke
c6211cc6c2
sys/event: Allow shared thread for multiple queues
Allow using `event_loop_multi()` to handle event queues of multiple priorities
in an single thread. In the extreme case, all three event queues are handled
by a single thread (thus saving two stacks). This comes for the price of
increased worst case latency, as already running event handlers will no longer
be preempted by higher priority events.

With this, all three event queue priorities are always provided. Using modules,
the old behavior of one thread per event queue can be restored for better worst
case latency at the expense of additional thread size.
2020-12-03 15:28:35 +01:00
Marian Buschsieweke
3b6fa61829
sys: Cleanup access to internal variables
Replace direct accesses to sched_active_thread and sched_active_pid with
the helper functions thread_getpid() and thread_get_active(). This serves
two purposes:

1. It makes accidental writes to those variable from outside core less likely.
2. Casting off the volatile qualifier is now well contained to those two
   functions
2020-08-24 20:28:11 +02:00
Marian Buschsieweke
a5c4692806
sys/event: Add multi-queue initializers
Add a set of helper functions to initialize / claim an array of queues and use
this in `tests/events`.
2020-08-05 11:59:40 +02:00
Marian Buschsieweke
2c03dfca13
sys/event: Made trivial functions static inline
When the expected ROM overhead of a function is bigger than the actual function,
it is better to provide the function as static inline function in the header.
2020-08-05 11:45:53 +02:00
Marian Buschsieweke
8bda9fac1b
sys/event: Add support for multiple queues
Added `event_wait_multi()` that takes an array of event queues rather than
a single event queues. The queue with the lowest index will have the highest
priority.
2020-08-04 13:30:25 +02:00
Hauke Petersen
e06cbce940 sys/event: add event_wait_timeout64() 2020-02-13 16:18:32 +01:00
4d7af5d170 sys/event: fix typo: imlementation -> implementation 2019-10-22 16:23:08 +02:00
Gunar Schorcht
f604d3dec8 sys/event: fix of compilation problems
Unstructured static initializer like { 0 } lead to compilation errors on ESP8266, MSP430 and MIPS. Error messages are:

error: (near initialization for 'queue.event_list') [-Werror=missing-braces]
error: (near initialization for 'queue.waiter') [-Werror=missing-field-initializers]

This change fixes the compilation problem.
2019-07-29 13:10:08 +02:00
Hauke Petersen
63d85ad1b5 sys/event: add event_wait_timeout() 2019-05-16 12:01:36 +02:00
0ec9c57b2b add copyrights from IOTPUSH project 2019-05-02 12:09:37 +02:00
Hauke Petersen
b9aeaa7418 sys/event: decouple event_queue from thread 2018-12-11 13:41:21 +01:00
Hauke Petersen
46888a1eaf sys/event: allow calling event_post multiple times 2018-04-19 16:41:13 +02:00
Jose Alamos
66cab7762a doc: fix event_t attribute in documentation 2018-02-08 09:59:16 +01:00
0e09213e53 sys/event: initial commit of handler-based event system 2017-11-06 14:19:31 +01:00