diff options
author | Ondrej Holy <oholy@redhat.com> | 2016-11-23 18:03:05 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2016-11-24 16:17:35 +0100 |
commit | 57acc8081cb67c3176d164abef02f878e40ab688 (patch) | |
tree | 3ede359512b69282c1005b20664f5ec9c5f7c2b9 | |
parent | 1224147b051af726c8b33f34d37ef78015ed5b95 (diff) | |
download | gvfs-57acc8081cb67c3176d164abef02f878e40ab688.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
-rw-r--r-- | client/gdaemonvfs.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c index ab6615bf..a61c0245 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); } } |