From eecd1362f7f4de432483b5d77c56726c3621a83a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 5 May 2012 00:34:48 +0200 Subject: logind: implement delay inhibitor locks in addition to block inhibitor locks This is useful to allow applications to synchronously save data before the system is suspended or shut down. --- src/login/logind.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/login/logind.h') diff --git a/src/login/logind.h b/src/login/logind.h index 4e9dcd5fed..2c0545206d 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -81,6 +81,14 @@ struct Manager { Hashmap *cgroups; Hashmap *session_fds; Hashmap *inhibitor_fds; + + /* If a shutdown was delayed due to a inhibitor this contains + the unit name we are supposed to start after the delay is + over */ + const char *delayed_shutdown; + usec_t delayed_shutdown_timestamp; + + usec_t inhibit_delay_max; }; enum { @@ -132,6 +140,8 @@ DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *message, vo int manager_send_changed(Manager *manager, const char *properties); +int manager_dispatch_delayed_shutdown(Manager *manager); + /* gperf lookup function */ const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned length); -- cgit v1.2.3-54-g00ecf