about summary refs log tree commit diff
path: root/src/NetworkManagerUtils.h
diff options
context:
space:
mode:
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__ */