diff options
author | José Bollo <jose.bollo@iot.bzh> | 2019-02-14 09:37:26 +0100 |
---|---|---|
committer | Jose Bollo <jose.bollo@iot.bzh> | 2019-03-27 10:48:40 +0100 |
commit | c330ecf92fef81fdb0471715326b8bc6b4d52bc6 (patch) | |
tree | b403a04b9035d326ff97f6b58f1a51e58014fe59 /src/watchdog.c | |
parent | d7e4faba5d1744160d538edd74bc4bdd8a173b1a (diff) |
system & jobs: Reverse link and acquiring events
- The new version of 'systemd_get_event_loop' dont depends
anymore on jobs but returns a unique systemd event loop
for any threads.
- The event loop of jobs now use system.h function instead
of the opposite.
- The function 'jobs_get_sd_event' is removed
- The function 'jobs_acquire_event_manager' is introduced.
It is designed to that the current thread can manipulate
the single event manager
Change-Id: I31fe48dfe0f2cfa4d468e49338d36fea6e7e8081
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/watchdog.c')
-rw-r--r-- | src/watchdog.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/watchdog.c b/src/watchdog.c index f9afd640..92144ba0 100644 --- a/src/watchdog.c +++ b/src/watchdog.c @@ -27,12 +27,15 @@ #include <systemd/sd-daemon.h> #include "jobs.h" +#include "systemd.h" int watchdog_activate() { /* set the watchdog */ - if (sd_watchdog_enabled(0, NULL)) - sd_event_set_watchdog(jobs_get_sd_event(), 1); + if (sd_watchdog_enabled(0, NULL)) { + jobs_acquire_event_manager(); + sd_event_set_watchdog(systemd_get_event_loop(), 1); + } return 0; } |