[gvfs/gdbus] gdbus: Remove shared volume monitor proxy locking



commit 6f72defd569ab03f768cbdb5c3fd5be9f286808a
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Mon May 21 15:24:46 2012 +0200

    gdbus: Remove shared volume monitor proxy locking
    
    Since it didn't work and GVolumeMonitor implementations should not
    be used from threads:
    
      "GVolumeMonitor is not thread-default-context aware, and so
       should not be used other than from the main thread, with
       no thread-default-context active."

 monitor/proxy/gproxydrive.c         |    6 ------
 monitor/proxy/gproxymount.c         |    2 --
 monitor/proxy/gproxyvolume.c        |    2 --
 monitor/proxy/gproxyvolumemonitor.c |   14 --------------
 monitor/proxy/gproxyvolumemonitor.h |    4 ----
 5 files changed, 0 insertions(+), 28 deletions(-)
---
diff --git a/monitor/proxy/gproxydrive.c b/monitor/proxy/gproxydrive.c
index 581ec2a..558913f 100644
--- a/monitor/proxy/gproxydrive.c
+++ b/monitor/proxy/gproxydrive.c
@@ -635,7 +635,6 @@ g_proxy_drive_eject_with_operation (GDrive              *drive,
     }
 
   proxy = g_proxy_volume_monitor_get_dbus_proxy (data->drive->volume_monitor);
-  g_proxy_volume_monitor_lock_for_timeout ();
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), G_PROXY_VOLUME_MONITOR_DBUS_TIMEOUT);  /* 30 minute timeout */
   
   gvfs_remote_volume_monitor_call_drive_eject (proxy,
@@ -648,7 +647,6 @@ g_proxy_drive_eject_with_operation (GDrive              *drive,
                                                data);
 
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), -1);
-  g_proxy_volume_monitor_unlock_for_timeout ();
   g_object_unref (proxy);
 
   G_UNLOCK (proxy_drive);
@@ -787,7 +785,6 @@ g_proxy_drive_stop (GDrive              *drive,
     }
 
   proxy = g_proxy_volume_monitor_get_dbus_proxy (data->drive->volume_monitor);
-  g_proxy_volume_monitor_lock_for_timeout ();
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), G_PROXY_VOLUME_MONITOR_DBUS_TIMEOUT);  /* 30 minute timeout */
 
   gvfs_remote_volume_monitor_call_drive_stop (proxy,
@@ -800,7 +797,6 @@ g_proxy_drive_stop (GDrive              *drive,
                                               data);
   
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), -1);
-  g_proxy_volume_monitor_unlock_for_timeout ();
   g_object_unref (proxy);
 
   G_UNLOCK (proxy_drive);
@@ -965,7 +961,6 @@ g_proxy_drive_start (GDrive              *drive,
   data->mount_op_id = g_proxy_mount_operation_wrap (mount_operation, proxy_drive->volume_monitor);
 
   proxy = g_proxy_volume_monitor_get_dbus_proxy (data->drive->volume_monitor);
-  g_proxy_volume_monitor_lock_for_timeout ();
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), G_PROXY_VOLUME_MONITOR_DBUS_TIMEOUT);  /* 30 minute timeout */
 
   gvfs_remote_volume_monitor_call_drive_start (proxy,
@@ -978,7 +973,6 @@ g_proxy_drive_start (GDrive              *drive,
                                                data);
 
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), -1);
-  g_proxy_volume_monitor_unlock_for_timeout ();
   g_object_unref (proxy);
 
   G_UNLOCK (proxy_drive);
diff --git a/monitor/proxy/gproxymount.c b/monitor/proxy/gproxymount.c
index 7a5d0a5..88aa955 100644
--- a/monitor/proxy/gproxymount.c
+++ b/monitor/proxy/gproxymount.c
@@ -585,7 +585,6 @@ g_proxy_mount_unmount_with_operation (GMount              *mount,
     }
   
   proxy = g_proxy_volume_monitor_get_dbus_proxy (proxy_mount->volume_monitor);
-  g_proxy_volume_monitor_lock_for_timeout ();
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), G_PROXY_VOLUME_MONITOR_DBUS_TIMEOUT);  /* 30 minute timeout */
 
   gvfs_remote_volume_monitor_call_mount_unmount (proxy,
@@ -598,7 +597,6 @@ g_proxy_mount_unmount_with_operation (GMount              *mount,
                                                  data);
 
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), -1);
-  g_proxy_volume_monitor_unlock_for_timeout ();
   g_object_unref (proxy);
 
   G_UNLOCK (proxy_mount);
diff --git a/monitor/proxy/gproxyvolume.c b/monitor/proxy/gproxyvolume.c
index f433718..6f600ab 100644
--- a/monitor/proxy/gproxyvolume.c
+++ b/monitor/proxy/gproxyvolume.c
@@ -917,7 +917,6 @@ g_proxy_volume_mount (GVolume             *volume,
       data->mount_op_id = g_proxy_mount_operation_wrap (mount_operation, proxy_volume->volume_monitor);
 
       proxy = g_proxy_volume_monitor_get_dbus_proxy (proxy_volume->volume_monitor);
-      g_proxy_volume_monitor_lock_for_timeout ();
       g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), G_PROXY_VOLUME_MONITOR_DBUS_TIMEOUT);  /* 30 minute timeout */
 
       gvfs_remote_volume_monitor_call_volume_mount (proxy,
@@ -930,7 +929,6 @@ g_proxy_volume_mount (GVolume             *volume,
                                                     data);
 
       g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), -1);
-      g_proxy_volume_monitor_unlock_for_timeout ();
       g_object_unref (proxy);
 
       G_UNLOCK (proxy_volume);
diff --git a/monitor/proxy/gproxyvolumemonitor.c b/monitor/proxy/gproxyvolumemonitor.c
index f5fada9..6aab4dc 100644
--- a/monitor/proxy/gproxyvolumemonitor.c
+++ b/monitor/proxy/gproxyvolumemonitor.c
@@ -1318,20 +1318,6 @@ g_proxy_volume_monitor_get_dbus_proxy (GProxyVolumeMonitor *volume_monitor)
   return g_object_ref (volume_monitor->proxy);
 }
 
-G_LOCK_DEFINE_STATIC(proxy_timeout);
-
-void
-g_proxy_volume_monitor_lock_for_timeout ()
-{
-  G_LOCK (proxy_timeout);
-}
-
-void
-g_proxy_volume_monitor_unlock_for_timeout ()
-{
-  G_UNLOCK (proxy_timeout);
-}
-
 static void
 register_volume_monitor (GTypeModule *type_module,
                          const char *type_name,
diff --git a/monitor/proxy/gproxyvolumemonitor.h b/monitor/proxy/gproxyvolumemonitor.h
index e2f4b17..137e56b 100644
--- a/monitor/proxy/gproxyvolumemonitor.h
+++ b/monitor/proxy/gproxyvolumemonitor.h
@@ -74,10 +74,6 @@ GProxyMount     *g_proxy_volume_monitor_get_mount_for_id  (GProxyVolumeMonitor *
                                                           const char          *id);
 GVfsRemoteVolumeMonitor *g_proxy_volume_monitor_get_dbus_proxy (GProxyVolumeMonitor *volume_monitor);
 
-/* This is to avoid -Wunused-variable warnings when lock is defined as static in public header file */
-void             g_proxy_volume_monitor_lock_for_timeout   (void);
-void             g_proxy_volume_monitor_unlock_for_timeout (void);
-
 void g_proxy_volume_monitor_teardown_session_bus_connection (void);
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]