[systemd-devel] [PATCH 1/2] Add sd_event_loop_timeout to sd_event

Lennart Poettering lennart at poettering.net
Wed Feb 4 08:10:02 PST 2015


On Wed, 04.02.15 17:05, Didier Roche (didrocks at ubuntu.com) wrote:

> Hey,
> 
> I rewrote a version of this patch including the feedback on the list. As per
> IRC discussion, (and after giving up the busy loop for a rewrite with
> epool), I did rebase it again on sd_event.
> 
> I'm only proposing there up for review the 2 first patches (without plymouth
> communication, cancel support, i18n, man pages and the service and socket)
> so that I don't have to rebase all other 10 patches on a moving
> ground.

Tom just added support for installing timer events with a NULL
callback, that trigger event loop exit. I kinda prefer that solution
over a new call sd_event_loop() with timeout.

     sd_event_add_time(event, NULL, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + 5 * USEC_PER_SEC, NULL, NULL);

That line should be enough to mak an even loop exit after 5s...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list