diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-05-05 11:22:14 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-05-13 14:34:53 +0200 |
commit | 69ab984fed80c70d1937684ee1884bd53ca6551f (patch) | |
tree | 2edd67103dc2615ba124186a9f090538cb8e5948 /src/nm-sleep-monitor.h | |
parent | 31c2e0b57c96dc4779d9e62db7b101560cb476d8 (diff) | |
download | NetworkManager-69ab984fed80c70d1937684ee1884bd53ca6551f.tar.gz |
sleep-monitor: add functions for delaying the suspension
To allow the execution of asynchronous actions before the system is
suspended, add a mechanism for delaying the drop of inhibitor lock.
Clients can supend the suspension by calling inhibit_take() in their
handler for SLEEPING signal and use inhibit_release() later when they
are done.
We take a "delay" type inhibitor lock, which means that the system
will proceed anyway after a certain amount of time.
Co-Authored-By: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'src/nm-sleep-monitor.h')
-rw-r--r-- | src/nm-sleep-monitor.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nm-sleep-monitor.h b/src/nm-sleep-monitor.h index 494a188eae..140f964f06 100644 --- a/src/nm-sleep-monitor.h +++ b/src/nm-sleep-monitor.h @@ -36,6 +36,12 @@ typedef struct _NMSleepMonitorClass NMSleepMonitorClass; GType nm_sleep_monitor_get_type (void) G_GNUC_CONST; NMSleepMonitor *nm_sleep_monitor_new (void); +typedef struct _NMSleepMonitorInhibitorHandle NMSleepMonitorInhibitorHandle; + +NMSleepMonitorInhibitorHandle *nm_sleep_monitor_inhibit_take (NMSleepMonitor *self); +void nm_sleep_monitor_inhibit_release (NMSleepMonitor *self, + NMSleepMonitorInhibitorHandle *handle); + G_END_DECLS #endif /* __NETWORKMANAGER_SLEEP_MONITOR_H__ */ |