diff options
author | Thomas Haller <thaller@redhat.com> | 2020-04-23 14:23:23 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-04-24 19:36:53 +0200 |
commit | 0119fa8c3d98ef9704051d936d573147eab2610d (patch) | |
tree | 3e932ad47b6e037842d89c4cf147df4152daf179 /src/devices/bluetooth/nm-bluez-manager.c | |
parent | 02a31e71afbc1f62dfead8eb08878d10b1efaf95 (diff) | |
download | NetworkManager-0119fa8c3d98ef9704051d936d573147eab2610d.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.
(cherry picked from commit cd5157a0c38adb20eb290a145888703b3d09dd4f)
Diffstat (limited to 'src/devices/bluetooth/nm-bluez-manager.c')
-rw-r--r-- | src/devices/bluetooth/nm-bluez-manager.c | 6 |
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); |