summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2016-11-23 18:03:05 +0100
committerOndrej Holy <oholy@redhat.com>2016-12-12 10:41:02 +0100
commitd455f97e3577445ed3c4ef6ddad0365bc4284453 (patch)
tree82f847222b1e3210cdf3fc21fcf37b1e71ec4805 /client
parentc30bec400315052c87feb260cf0a5cf78366d710 (diff)
downloadgvfs-d455f97e3577445ed3c4ef6ddad0365bc4284453.tar.gz
client: Use sync methods instead of flushing dbus
g_dbus_connection_flush_sync causes troubles in certain cases when using multiple threads. The problem occurs when there are ongoing gvfs_metadata_call_set_sync calls. It blocks threads e.g. when moving files over Nautilus. Nautilus freezes sometimes due to it. Use sync methods instead of flushing dbus. I don't see any significant slowdown when using sync methods instead of the flushing according to my testing. It fixes hangs in Nautilus and moving in Nautilus is almost instant again. https://bugzilla.gnome.org/show_bug.cgi?id=757747
Diffstat (limited to 'client')
-rw-r--r--client/gdaemonvfs.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index be1bbc6c..eddbdaf9 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -1356,16 +1356,11 @@ g_daemon_vfs_local_file_removed (GVfs *vfs,
if (proxy)
{
metatreefile = meta_tree_get_filename (tree);
- /* we don't care about the result, let's queue the call and don't block */
- gvfs_metadata_call_remove (proxy,
- metatreefile,
- tree_path,
- NULL,
- NULL, /* callback */
- NULL);
- /* flush the call with the expense of sending all queued messages on the connection */
- g_dbus_connection_flush_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (proxy)),
- NULL, NULL);
+ gvfs_metadata_call_remove_sync (proxy,
+ metatreefile,
+ tree_path,
+ NULL,
+ NULL);
}
meta_tree_unref (tree);
@@ -1403,17 +1398,12 @@ g_daemon_vfs_local_file_moved (GVfs *vfs,
if (proxy)
{
metatreefile = meta_tree_get_filename (tree1);
- /* we don't care about the result, let's queue the call and don't block */
- gvfs_metadata_call_move (proxy,
- metatreefile,
- tree_path1,
- tree_path2,
- NULL,
- NULL, /* callback */
- NULL);
- /* flush the call with the expense of sending all queued messages on the connection */
- g_dbus_connection_flush_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (proxy)),
- NULL, NULL);
+ gvfs_metadata_call_move_sync (proxy,
+ metatreefile,
+ tree_path1,
+ tree_path2,
+ NULL,
+ NULL);
}
}