summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/test-event.c
AgeCommit message (Collapse)Author
2013-10-21sd-event: EPOLLONESHOT only disables event reporting after an event. The fd ↵David Strauss
is still registered.
2013-10-11event: rename the "mute" field of event sources to "enabled"Lennart Poettering
In addition, the states "UNMUTED" and "MUTED" become "ON" and "OFF". This has the benefit that a possible value of this field is not identical to its name, thus minimizing confusion.
2013-10-11event: implement quit handlersLennart Poettering
Quit handlers are executed when an event loop is terminated via sd_event_request_quit(). They are in a way atexit() handlers that are executed in a well-defined environment, time and thread: from the event loop thread when the event loop finishes.
2013-10-10event: add timer accuracy/coalescing logicLennart Poettering
In order to improve energy consumption we should minimize our wake-ups when handling timers. Hence, for each timer take an accuracy value and schedule the actual wake-up time somewhere between the specified time and the specified timer plus the accuracy. The specified time of timer event sources hence becomes the time the handler is called the *earliest*, and the specified time plus the accuracy the time by which it is called the *latest*, leaving the library the freedom to schedule the wake-up somewhere inbetween. If the accuracy is specified as 0 the default of 250ms will be used. When scheduling timeouts we will now try to elapse them at the same point within each second, across the entire system. We do this by using a fixed perturbation value keyed off the boot id. If this point within a second is not in the acceptable range, we try again with a fixed time within each 250ms time step. If that doesn't work either, we wake up at the last possible time.
2013-10-10bus: add minimal event loop APILennart Poettering
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.