[gvfs/gnome-3-22] client: Use sync methods instead of flushing dbus
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/gnome-3-22] client: Use sync methods instead of flushing dbus
- Date: Mon, 12 Dec 2016 10:01:39 +0000 (UTC)
commit d455f97e3577445ed3c4ef6ddad0365bc4284453
Author: Ondrej Holy <oholy redhat com>
Date: Wed Nov 23 18:03:05 2016 +0100
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
client/gdaemonvfs.c | 32 +++++++++++---------------------
1 files changed, 11 insertions(+), 21 deletions(-)
---
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index be1bbc6..eddbdaf 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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]