diff options
author | Dan Williams <dcbw@redhat.com> | 2007-01-04 12:06:26 +0000 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2007-01-04 12:06:26 +0000 |
commit | 0df1e42c39d3ddc000d9c4bf2057e96b4fc97bd9 (patch) | |
tree | c76cf32d2c43bdd9124a7f6a436b88c3cda17059 /src/supplicant-manager/nm-supplicant-interface.c | |
parent | 2ea7f1e5ea8120926b7bcf1f103800943ca44cfb (diff) | |
download | NetworkManager-0df1e42c39d3ddc000d9c4bf2057e96b4fc97bd9.tar.gz |
2007-01-04 Dan Williams <dcbw@redhat.com>
Threading removal related cleanups:
- Use the glib default main context. Remove the device main context
member from NMDevice, and the main_context member from NMData. Change
all the idle and timeout scheduler functions to use plain
g_idle_add() and g_timeout_add().
- As a side-effect of the first change, nm_dbus_manager_get() no longer
takes an argument; fix that up too.
- Remove all locking, which is useless since we no longer use threads. For
example, nm_get_device_by_iface_locked() has been removed. The global
device list lock, the AP List lock, and all static locks in
NetworkManagerPolicy.c have been removed. The locking utility functions
in NetworkManagerUtils.c have also been removed.
- Other cleanups in spacing and code style
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2205 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'src/supplicant-manager/nm-supplicant-interface.c')
-rw-r--r-- | src/supplicant-manager/nm-supplicant-interface.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 28cc79568e..aac2f7f723 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -204,7 +204,7 @@ nm_supplicant_interface_init (NMSupplicantInterface * self) self->priv->other_pcalls = NULL; self->priv->dispose_has_run = FALSE; - self->priv->dbus_mgr = nm_dbus_manager_get (NULL); + self->priv->dbus_mgr = nm_dbus_manager_get (); } @@ -745,13 +745,14 @@ wpas_iface_query_scan_results (NMSupplicantInterface * self) /* Only fetch scan results every 4s max, but initially do it right away */ if (self->priv->last_scan == 0) { - source = g_idle_source_new (); + id = g_idle_add (request_scan_results, self); } else { - source = g_timeout_source_new (4000); + id = g_timeout_add (4000, request_scan_results, self); + } + if (id > 0) { + source = g_main_context_find_source_by_id (NULL, id); + self->priv->scan_results_timeout = source; } - g_source_set_callback (source, request_scan_results, self, NULL); - id = g_source_attach (source, app_data->main_context); - self->priv->scan_results_timeout = source; } static guint32 |