]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/libsystemd/sd-event/sd-event.c
sd-event: split out helper functions for reshuffling prioqs
authorMichal Sekletár <msekleta@redhat.com>
Fri, 23 Oct 2020 16:29:27 +0000 (18:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2020 13:01:14 +0000 (14:01 +0100)
commite1951c16a8fbe5b0b9ecc08f4f835a806059d28f
tree5169ffb943f910ffe85b5e2be4e8250f16676edf
parente08dabfec7304dfa0d59997dc4219ffaf22af717
sd-event: split out helper functions for reshuffling prioqs

We typically don't just reshuffle a single prioq at once, but always
two. Let's add two helper functions that do this, and reuse them
everywhere.

(Note that this drops one minor optimization:
sd_event_source_set_time_accuracy() previously only reshuffled the
"latest" prioq, since changing the accuracy has no effect on the
earliest time of an event source, just the latest time an event source
can run. This optimization is removed to simplify things, given that
it's not really worth the effort as prioq_reshuffle() on properly
ordered prioqs has practically zero cost O(1)).

(Slightly generalized, commented and split out of #17284 by Lennart)
src/libsystemd/sd-event/sd-event.c