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
This commit is contained in:
Dan Williams
2007-01-04 12:06:26 +00:00
parent 2ea7f1e5ea
commit 0df1e42c39
31 changed files with 492 additions and 1029 deletions

View File

@@ -89,17 +89,13 @@ void nm_act_request_unref (NMActRequest *req)
g_return_if_fail (req != NULL);
req->refcount--;
if (req->refcount <= 0)
{
if (req->refcount <= 0) {
g_object_unref (G_OBJECT (req->dev));
if (req->ap)
nm_ap_unref (req->ap);
if (req->dhcp_timeout > 0)
{
GSource * source = g_main_context_find_source_by_id (req->data->main_context, req->dhcp_timeout);
g_source_destroy (source);
}
g_source_remove (req->dhcp_timeout);
memset (req, 0, sizeof (NMActRequest));
g_free (req);
@@ -182,7 +178,7 @@ void nm_act_request_set_stage (NMActRequest *req, NMActStage stage)
g_return_if_fail (req->data);
g_return_if_fail (req->dev);
dbus_mgr = nm_dbus_manager_get (NULL);
dbus_mgr = nm_dbus_manager_get ();
dbus_connection = nm_dbus_manager_get_dbus_connection (dbus_mgr);
if (!dbus_connection) {
nm_warning ("couldn't get the dbus connection.");