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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user