summaryrefslogtreecommitdiff
path: root/gnome-base/gvfs/files/gvfs-1.24.2-guard-caches.patch
blob: 4bf90ad1f26c17d499e254e904879d12a93e25d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 1220260f96a9ce2beb659da30888ea9648719e9a Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Wed, 30 Sep 2015 12:38:55 +0200
Subject: proxy volume monitor: Guard access to the internal caches

Accesses to the drives, volumes and mounts hash tables should be
guarded by the proxy_vm mutex.

https://bugzilla.gnome.org/show_bug.cgi?id=755805
---
 monitor/proxy/gproxyvolumemonitor.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/monitor/proxy/gproxyvolumemonitor.c b/monitor/proxy/gproxyvolumemonitor.c
index 623cb14..17474a8 100644
--- a/monitor/proxy/gproxyvolumemonitor.c
+++ b/monitor/proxy/gproxyvolumemonitor.c
@@ -867,6 +867,8 @@ name_owner_appeared (GProxyVolumeMonitor *monitor)
   GProxyVolume *volume;
   GProxyMount *mount;
 
+  G_LOCK (proxy_vm);
+
   seed_monitor (monitor);
 
   /* emit signals for all the drives/volumes/mounts "added" */
@@ -881,6 +883,8 @@ name_owner_appeared (GProxyVolumeMonitor *monitor)
   g_hash_table_iter_init (&hash_iter, monitor->mounts);
   while (g_hash_table_iter_next (&hash_iter, NULL, (gpointer) &mount))
     signal_emit_in_idle (monitor, "mount-added", mount);
+
+  G_UNLOCK (proxy_vm);
 }
 
 static void
@@ -891,6 +895,8 @@ name_owner_vanished (GProxyVolumeMonitor *monitor)
   GProxyVolume *volume;
   GProxyMount *mount;
 
+  G_LOCK (proxy_vm);
+
   g_hash_table_iter_init (&hash_iter, monitor->mounts);
   while (g_hash_table_iter_next (&hash_iter, NULL, (gpointer) &mount))
     {
@@ -914,6 +920,8 @@ name_owner_vanished (GProxyVolumeMonitor *monitor)
       signal_emit_in_idle (monitor, "drive-disconnected", drive);
     }
   g_hash_table_remove_all (monitor->drives);
+
+  G_UNLOCK (proxy_vm);
 }
 
 static void
-- 
cgit v0.11.2