diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-10-10 04:40:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-10 04:44:48 +0200 |
commit | fd38203a2a7bfbdc6cb5fd4dc54378e70f7d6778 (patch) | |
tree | 4a4c8a464f489825f94e5edd757408bda16fc9ee /src/shared | |
parent | 2b98f75a63e6022bf74a7d678c47faa5208c794f (diff) |
bus: add minimal event loop API
So far we tried to use epoll directly wherever we needed an event loop.
However, that has various shortcomings, such as the inability to handle
larger amounts of timers (since each timerfd costs one fd, which is a
very limited resource, usually bounded to 1024), and inability to do
priorisation between multiple queued events.
Let's add a minimal event loop API around epoll that is suitable for
implementation of our own daemons and maybe one day can become public
API for those who desire it.
This loop is part of libsystemd-bus, but may be used independently of
it.
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/prioq.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/prioq.h b/src/shared/prioq.h index 4a206a3e59..d836b36cd9 100644 --- a/src/shared/prioq.h +++ b/src/shared/prioq.h @@ -25,6 +25,8 @@ typedef struct Prioq Prioq; +#define PRIOQ_IDX_NULL ((unsigned) -1) + Prioq *prioq_new(compare_func_t compare); void prioq_free(Prioq *q); int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func); |