diff --git a/src/core/NetworkManagerUtils.c b/src/core/NetworkManagerUtils.c index c4df566eab..2f30bcaa39 100644 --- a/src/core/NetworkManagerUtils.c +++ b/src/core/NetworkManagerUtils.c @@ -34,6 +34,10 @@ /*****************************************************************************/ +G_STATIC_ASSERT(NM_SHUTDOWN_TIMEOUT_1500_MSEC <= NM_SHUTDOWN_TIMEOUT_MAX_MSEC); + +/*****************************************************************************/ + /** * nm_utils_get_shared_wifi_permission: * @connection: the NMConnection to lookup the permission. diff --git a/src/core/NetworkManagerUtils.h b/src/core/NetworkManagerUtils.h index 465f19b80f..fce940073b 100644 --- a/src/core/NetworkManagerUtils.h +++ b/src/core/NetworkManagerUtils.h @@ -121,6 +121,17 @@ NMPlatformRoutingRule *nm_ip_routing_rule_to_platform(const NMIPRoutingRule *rul #define NM_SHUTDOWN_TIMEOUT_MAX_MSEC 1500 #define NM_SHUTDOWN_TIMEOUT_ADDITIONAL_MSEC 500 +/** + * NM_SHUTDOWN_TIMEOUT_1500_MSEC: this is just 1500 msec. The special + * thing about the define is that you are guaranteed that this is not + * longer than NM_SHUTDOWN_TIMEOUT_MAX_MSEC. + * When you perform an async operation, it must either be cancellable + * (and complete fast) or never take longer than NM_SHUTDOWN_TIMEOUT_MAX_MSEC. + * The usage of this macro makes that relation to NM_SHUTDOWN_TIMEOUT_MAX_MSEC + * explicit. + */ +#define NM_SHUTDOWN_TIMEOUT_1500_MSEC 1500 + typedef enum { /* There is no watched_obj argument, and the shutdown is delayed until the user * explicitly calls unregister on the returned handle. */