summaryrefslogtreecommitdiff
path: root/src/nm-sleep-monitor.h
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-05-05 11:22:14 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2016-05-13 14:34:53 +0200
commit69ab984fed80c70d1937684ee1884bd53ca6551f (patch)
tree2edd67103dc2615ba124186a9f090538cb8e5948 /src/nm-sleep-monitor.h
parent31c2e0b57c96dc4779d9e62db7b101560cb476d8 (diff)
downloadNetworkManager-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.h6
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__ */