summaryrefslogtreecommitdiffstats
path: root/src/shared/prioq.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-10-10 04:40:28 +0200
committerLennart Poettering <lennart@poettering.net>2013-10-10 04:44:48 +0200
commitfd38203a2a7bfbdc6cb5fd4dc54378e70f7d6778 (patch)
tree4a4c8a464f489825f94e5edd757408bda16fc9ee /src/shared/prioq.h
parentjournald: remove rotated file from hashmap when rotation fails (diff)
downloadsystemd-fd38203a2a7bfbdc6cb5fd4dc54378e70f7d6778.tar.xz
systemd-fd38203a2a7bfbdc6cb5fd4dc54378e70f7d6778.zip
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/prioq.h')
-rw-r--r--src/shared/prioq.h2
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);