summaryrefslogtreecommitdiff
path: root/src/devices/bluetooth/nm-bluez-manager.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-04-23 14:23:23 +0200
committerThomas Haller <thaller@redhat.com>2020-04-24 13:58:46 +0200
commitcd5157a0c38adb20eb290a145888703b3d09dd4f (patch)
tree993a391fe97cdbb15329ad3add115145d625c54d /src/devices/bluetooth/nm-bluez-manager.c
parent93b634f1a23c43dd71c3b7668ae738c3ab6c970e (diff)
downloadNetworkManager-cd5157a0c38adb20eb290a145888703b3d09dd4f.tar.gz
shared: add nm_utils_invoke_on_timeout()
Add nm_utils_invoke_on_timeout() beside nm_utils_invoke_on_idle(). They are fundamentally similar, except one schedules an idle handler and the other a timeout. Also, use the current g_main_context_get_thread_default() as context instead of the singleton instance. That is a change in behavior, but the only caller of nm_utils_invoke_on_idle() is the daemon, which doesn't use different main contexts. Anyway, to avoid anybody being tripped up by this also change the order of arguments. It anyway seems nicer to first pass the cancellable, and the callback and user data as last arguments. It's more in line with glib's asynchronous methods. Also, in the unlikely case that the cancellable is already cancelled from the start, always schedule an idle action to complete fast.
Diffstat (limited to 'src/devices/bluetooth/nm-bluez-manager.c')
-rw-r--r--src/devices/bluetooth/nm-bluez-manager.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/devices/bluetooth/nm-bluez-manager.c b/src/devices/bluetooth/nm-bluez-manager.c
index 6ff96c323b..0bbac4c435 100644
--- a/src/devices/bluetooth/nm-bluez-manager.c
+++ b/src/devices/bluetooth/nm-bluez-manager.c
@@ -1251,9 +1251,9 @@ _network_server_unregister_bridge (NMBluezManager *self,
if (r_req_data) {
nm_clear_g_cancellable (&r_req_data->int_cancellable);
- nm_utils_invoke_on_idle (_network_server_unregister_bridge_complete_on_idle_cb,
- nm_utils_user_data_pack (r_req_data, g_strdup (reason)),
- r_req_data->ext_cancellable);
+ nm_utils_invoke_on_idle (r_req_data->ext_cancellable,
+ _network_server_unregister_bridge_complete_on_idle_cb,
+ nm_utils_user_data_pack (r_req_data, g_strdup (reason)));
}
_nm_device_bridge_notify_unregister_bt_nap (device, reason);