summary refs log tree commit diff
path: root/src/NetworkManagerUtils.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-06-04 00:08:31 +0200
committerMichael Biebl <biebl@debian.org>2018-06-04 00:08:31 +0200
commit0dd9df69fdbd475c48a0c8d5b0a1882550fe7321 (patch)
tree249cf25643b1fe408e10679bb61613bc6540e894 /src/NetworkManagerUtils.h
parent2e94a3b93171ab3fb95bf689aab1664d23988809 (diff)
parent04bc9e1cd3544445d883ad29ea108c1645c8e7b7 (diff)
Update upstream source from tag 'upstream/1.11.4'
Update to upstream version '1.11.4'
with Debian dir d0638aa2e32d5bae4e8daa021b9a66b7c4d6647e
Diffstat (limited to 'src/NetworkManagerUtils.h')
-rw-r--r--src/NetworkManagerUtils.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h
index 13bdb67e..b26d08bd 100644
--- a/src/NetworkManagerUtils.h
+++ b/src/NetworkManagerUtils.h
@@ -53,6 +53,37 @@ int nm_match_spec_device_by_pllink (const NMPlatformLink *pllink,
                                     const GSList *specs,
                                     int no_match_value);
 
+
+/*****************************************************************************/
+
+/* during shutdown, there are two relevant timeouts. One is
+ * NM_SHUTDOWN_TIMEOUT_MS which is plenty of time, that we give for all
+ * actions to complete. Of course, during shutdown components should hurry
+ * to cleanup.
+ *
+ * When we initiate shutdown, we should start killing child processes
+ * with SIGTERM. If they don't complete within NM_SHUTDOWN_TIMEOUT_MS, we send
+ * SIGKILL.
+ *
+ * After NM_SHUTDOWN_TIMEOUT_MS, NetworkManager will however not yet terminate right
+ * away. It iterates the mainloop for another NM_SHUTDOWN_TIMEOUT_MS_EXTRA. This
+ * should give time to reap the child process (after SIGKILL).
+ *
+ * So, the maxiumum time we should wait before sending SIGKILL should be at most
+ * NM_SHUTDOWN_TIMEOUT_MS.
+ */
+#define NM_SHUTDOWN_TIMEOUT_MS            1500
+#define NM_SHUTDOWN_TIMEOUT_MS_WATCHDOG    500
+
+typedef struct _NMShutdownWaitObjHandle NMShutdownWaitObjHandle;
+
+NMShutdownWaitObjHandle *_nm_shutdown_wait_obj_register (GObject *watched_obj,
+                                                        const char *msg_reason);
+
+#define nm_shutdown_wait_obj_register(watched_obj, msg_reason) _nm_shutdown_wait_obj_register((watched_obj), (""msg_reason""))
+
+void nm_shutdown_wait_obj_unregister (NMShutdownWaitObjHandle *handle);
+
 /*****************************************************************************/
 
 #endif /* __NETWORKMANAGER_UTILS_H__ */