aboutsummaryrefslogtreecommitdiffstats
path: root/meta-gnome/recipes-gnome/gvfs/files/0002-Adapt-to-GLib-2.31-deprecations-and-thread-API-chang.patch
blob: 0aa9271150d1cef05a7bdd392cfb0f8da5247196 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
From bd014bd8a442cae12aace7deb6e6a4d21ac3dd0e Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 21 Oct 2011 14:15:09 +0200
Subject: [PATCH] Adapt to GLib 2.31 deprecations and thread API changes

GStaticMutex and GStaticRWLock have been replaced by GMutex
and GRWLock, and g_thread_init() is no longer needed.

https://bugzilla.gnome.org/show_bug.cgi?id=661148

Upstream-Status: Backport

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
 client/gdaemonvfs.c                          |    5 +-
 client/gvfsdaemondbus.c                      |   15 ++++---
 client/gvfsfusedaemon.c                      |    1 -
 common/gmounttracker.c                       |   43 ++++++------------
 configure.ac                                 |    2 +-
 daemon/daemon-main.c                         |    1 -
 daemon/gvfsdaemonutils.c                     |    8 ++--
 daemon/main.c                                |    2 -
 metadata/metatree.c                          |   60 +++++++++++++-------------
 monitor/proxy/gvfsproxyvolumemonitordaemon.c |    1 -
 10 files changed, 60 insertions(+), 78 deletions(-)

diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 0f021b9..ae17c3c 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -298,9 +298,8 @@ g_daemon_vfs_init (GDaemonVfs *vfs)
 
   bindtextdomain (GETTEXT_PACKAGE, GVFS_LOCALEDIR);
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-  
-  if (g_thread_supported ())
-    dbus_threads_init_default ();
+
+  dbus_threads_init_default ();
 
   vfs->async_bus = dbus_bus_get_private (DBUS_BUS_SESSION, NULL);
 
diff --git a/client/gvfsdaemondbus.c b/client/gvfsdaemondbus.c
index f32a6f8..2cfd2e6 100644
--- a/client/gvfsdaemondbus.c
+++ b/client/gvfsdaemondbus.c
@@ -53,7 +53,10 @@ typedef struct {
 static gint32 vfs_data_slot = -1;
 static GOnce once_init_dbus = G_ONCE_INIT;
 
-static GStaticPrivate local_connections = G_STATIC_PRIVATE_INIT;
+typedef struct _ThreadLocalConnections ThreadLocalConnections;
+static void free_local_connections (ThreadLocalConnections *local);
+
+static GPrivate local_connections = G_PRIVATE_INIT((GDestroyNotify)free_local_connections);
 
 /* dbus id -> async connection */
 static GHashTable *async_map = NULL;
@@ -862,10 +865,10 @@ _g_vfs_daemon_call_sync (DBusMessage *message,
  *               get per-thread synchronous dbus connections             *
  *************************************************************************/
 
-typedef struct {
+struct _ThreadLocalConnections {
   GHashTable *connections;
   DBusConnection *session_bus;
-} ThreadLocalConnections;
+};
 
 static void
 free_mount_connection (DBusConnection *conn)
@@ -891,7 +894,7 @@ invalidate_local_connection (const char *dbus_id,
   
   _g_daemon_vfs_invalidate_dbus_id (dbus_id);
 
-  local = g_static_private_get (&local_connections);
+  local = g_private_get (&local_connections);
   if (local)
     g_hash_table_remove (local->connections, dbus_id);
   
@@ -916,13 +919,13 @@ _g_dbus_connection_get_sync (const char *dbus_id,
 
   g_once (&once_init_dbus, vfs_dbus_init, NULL);
 
-  local = g_static_private_get (&local_connections);
+  local = g_private_get (&local_connections);
   if (local == NULL)
     {
       local = g_new0 (ThreadLocalConnections, 1);
       local->connections = g_hash_table_new_full (g_str_hash, g_str_equal,
 						  g_free, (GDestroyNotify)free_mount_connection);
-      g_static_private_set (&local_connections, local, (GDestroyNotify)free_local_connections);
+      g_private_set (&local_connections, local);
     }
 
   if (dbus_id == NULL)
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index a4ba32c..7cfa81c 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -2425,7 +2425,6 @@ gint
 main (gint argc, gchar *argv [])
 {
   g_type_init ();
-  g_thread_init (NULL);
 
   return fuse_main (argc, argv, &vfs_oper, NULL /* user data */);
 }
diff --git a/common/gmounttracker.c b/common/gmounttracker.c
index 519cd47..135a2b2 100644
--- a/common/gmounttracker.c
+++ b/common/gmounttracker.c
@@ -49,7 +49,7 @@ struct _GMountTracker
 {
   GObject parent_instance;
 
-  GMutex *lock;
+  GMutex lock;
   GList *mounts;
   DBusConnection *connection;
 };
@@ -258,8 +258,7 @@ g_mount_tracker_finalize (GObject *object)
 
   tracker = G_MOUNT_TRACKER (object);
 
-  if (tracker->lock)
-    g_mutex_free (tracker->lock);
+  g_mutex_clear (&tracker->lock);
   
   g_list_foreach (tracker->mounts,
 		  (GFunc)g_mount_info_unref, NULL);
@@ -382,21 +381,18 @@ static void
 g_mount_tracker_add_mount (GMountTracker *tracker,
 			   GMountInfo *info)
 {
-  if (tracker->lock)
-    g_mutex_lock (tracker->lock);
+  g_mutex_lock (&tracker->lock);
   
   /* Don't add multiple times */
   if (g_mount_tracker_find (tracker, info))
     {
-      if (tracker->lock)
-	g_mutex_unlock (tracker->lock);
+      g_mutex_unlock (&tracker->lock);
       return;
     }
 
   tracker->mounts = g_list_prepend (tracker->mounts, g_mount_info_ref (info));
 
-  if (tracker->lock)
-    g_mutex_unlock (tracker->lock);
+  g_mutex_unlock (&tracker->lock);
   
   g_signal_emit (tracker, signals[MOUNTED], 0, info);
 }
@@ -408,16 +404,14 @@ g_mount_tracker_remove_mount (GMountTracker *tracker,
   GList *l;
   GMountInfo *old_info;
 
-  if (tracker->lock)
-    g_mutex_lock (tracker->lock);
+  g_mutex_lock (&tracker->lock);
   
   l = g_mount_tracker_find (tracker, info);
   
   /* Don't remove multiple times */
   if (l == NULL)
     {
-      if (tracker->lock)
-	g_mutex_unlock (tracker->lock);
+      g_mutex_unlock (&tracker->lock);
       return;
     }
 
@@ -425,8 +419,7 @@ g_mount_tracker_remove_mount (GMountTracker *tracker,
   
   tracker->mounts = g_list_delete_link (tracker->mounts, l);
   
-  if (tracker->lock)
-    g_mutex_unlock (tracker->lock);
+  g_mutex_unlock (&tracker->lock);
 
   g_signal_emit (tracker, signals[UNMOUNTED], 0, old_info);
   g_mount_info_unref (old_info);
@@ -548,8 +541,6 @@ init_connection (GMountTracker *tracker)
 static void
 g_mount_tracker_init (GMountTracker *tracker)
 {
-  if (g_thread_supported ())
-    tracker->lock = g_mutex_new ();
 }
 
 
@@ -588,8 +579,7 @@ g_mount_tracker_list_mounts (GMountTracker *tracker)
   GList *res, *l;
   GMountInfo *copy;
 
-  if (tracker->lock)
-    g_mutex_lock (tracker->lock);
+  g_mutex_lock (&tracker->lock);
   
   res = NULL;
   for (l = tracker->mounts; l != NULL; l = l->next)
@@ -598,8 +588,7 @@ g_mount_tracker_list_mounts (GMountTracker *tracker)
       res = g_list_prepend (res, copy);
     }
 
-  if (tracker->lock)
-    g_mutex_unlock (tracker->lock);
+  g_mutex_unlock (&tracker->lock);
   
   return g_list_reverse (res);
 }
@@ -611,8 +600,7 @@ g_mount_tracker_find_by_mount_spec (GMountTracker *tracker,
   GList *l;
   GMountInfo *info, *found;
 
-  if (tracker->lock)
-    g_mutex_lock (tracker->lock);
+  g_mutex_lock (&tracker->lock);
 
   found = NULL;
   for (l = tracker->mounts; l != NULL; l = l->next)
@@ -626,8 +614,7 @@ g_mount_tracker_find_by_mount_spec (GMountTracker *tracker,
 	}
     }
 
-  if (tracker->lock)
-    g_mutex_unlock (tracker->lock);
+  g_mutex_unlock (&tracker->lock);
   
   return found;
 }
@@ -641,8 +628,7 @@ g_mount_tracker_has_mount_spec (GMountTracker *tracker,
   GMountInfo *info;
   gboolean found;
 
-  if (tracker->lock)
-    g_mutex_lock (tracker->lock);
+  g_mutex_lock (&tracker->lock);
 
   found = FALSE;
   for (l = tracker->mounts; l != NULL; l = l->next)
@@ -656,8 +642,7 @@ g_mount_tracker_has_mount_spec (GMountTracker *tracker,
 	}
     }
 
-  if (tracker->lock)
-    g_mutex_unlock (tracker->lock);
+  g_mutex_unlock (&tracker->lock);
   
   return found;
 }
diff --git a/configure.ac b/configure.ac
index ee2f90f..be0c6a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,7 +46,7 @@ GTK_DOC_CHECK
 DISTCHECK_CONFIGURE_FLAGS="--enable-gtk-doc"
 AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
 
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.29.14 gthread-2.0 gobject-2.0 gmodule-no-export-2.0 gio-unix-2.0 gio-2.0 )
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.31.0 gobject-2.0 gmodule-no-export-2.0 gio-unix-2.0 gio-2.0 )
 
 PKG_CHECK_MODULES(DBUS, dbus-1)
 
diff --git a/daemon/daemon-main.c b/daemon/daemon-main.c
index ef9025c..ff2bfde 100644
--- a/daemon/daemon-main.c
+++ b/daemon/daemon-main.c
@@ -63,7 +63,6 @@ daemon_init (void)
   textdomain (GETTEXT_PACKAGE);
   
   dbus_threads_init_default ();
-  g_thread_init (NULL);
   g_type_init ();
 
   g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, log_debug, NULL);
diff --git a/daemon/gvfsdaemonutils.c b/daemon/gvfsdaemonutils.c
index f03d4b2..1efcf87 100644
--- a/daemon/gvfsdaemonutils.c
+++ b/daemon/gvfsdaemonutils.c
@@ -41,7 +41,7 @@
 #include "gvfsdaemonprotocol.h"
 
 static gint32 extra_fd_slot = -1;
-static GStaticMutex extra_lock = G_STATIC_MUTEX_INIT;
+static GMutex extra_lock;
 
 typedef struct {
   int extra_fd;
@@ -93,7 +93,7 @@ dbus_connection_send_fd (DBusConnection *connection,
       return FALSE;
     }
 
-  g_static_mutex_lock (&extra_lock);
+  g_mutex_lock (&extra_lock);
 
   if (_g_socket_send_fd (extra->extra_fd, fd) == -1)
     {
@@ -103,13 +103,13 @@ dbus_connection_send_fd (DBusConnection *connection,
 		   g_io_error_from_errno (errsv),
 		   _("Error sending file descriptor: %s"),
 		   g_strerror (errsv));
-      g_static_mutex_unlock (&extra_lock);
+      g_mutex_unlock (&extra_lock);
       return FALSE;
     }
 
   *fd_id = extra->fd_count++;
 
-  g_static_mutex_unlock (&extra_lock);
+  g_mutex_unlock (&extra_lock);
 
   return TRUE;
 }
diff --git a/daemon/main.c b/daemon/main.c
index 4703562..2b2d549 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -52,8 +52,6 @@ main (int argc, char *argv[])
   bindtextdomain (GETTEXT_PACKAGE, GVFS_LOCALEDIR);
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
-  
-  g_thread_init (NULL);
 
 #ifdef SIGPIPE
   signal (SIGPIPE, SIG_IGN);
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 3420ad0..850866e 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -68,7 +68,7 @@
 
 #define KEY_IS_LIST_MASK (1<<31)
 
-static GStaticRWLock metatree_lock = G_STATIC_RW_LOCK_INIT;
+static GRWLock metatree_lock;
 
 typedef enum {
   JOURNAL_OP_SET_KEY,
@@ -591,7 +591,7 @@ meta_tree_lookup_by_name (const char *name,
 MetaTree *
 meta_tree_ref (MetaTree *tree)
 {
-  g_atomic_int_exchange_and_add ((int *)&tree->ref_count, 1);
+  g_atomic_int_inc ((int *)&tree->ref_count);
   return tree;
 }
 
@@ -672,17 +672,17 @@ meta_tree_refresh (MetaTree *tree)
 {
   gboolean needs_refresh;
 
-  g_static_rw_lock_reader_lock (&metatree_lock);
+  g_rw_lock_reader_lock (&metatree_lock);
   needs_refresh =
     meta_tree_needs_rereading (tree) ||
     meta_tree_has_new_journal_entries (tree);
-  g_static_rw_lock_reader_unlock (&metatree_lock);
+  g_rw_lock_reader_unlock (&metatree_lock);
 
   if (needs_refresh)
     {
-      g_static_rw_lock_writer_lock (&metatree_lock);
+      g_rw_lock_writer_lock (&metatree_lock);
       meta_tree_refresh_locked (tree);
-      g_static_rw_lock_writer_unlock (&metatree_lock);
+      g_rw_lock_writer_unlock (&metatree_lock);
     }
 }
 
@@ -1468,7 +1468,7 @@ meta_tree_lookup_key_type  (MetaTree                         *tree,
   MetaKeyType type;
   gpointer value;
 
-  g_static_rw_lock_reader_lock (&metatree_lock);
+  g_rw_lock_reader_lock (&metatree_lock);
 
   new_path = meta_journal_reverse_map_path_and_key (tree->journal,
 						    path,
@@ -1492,7 +1492,7 @@ meta_tree_lookup_key_type  (MetaTree                         *tree,
     type = META_KEY_TYPE_STRING;
 
  out:
-  g_static_rw_lock_reader_unlock (&metatree_lock);
+  g_rw_lock_reader_unlock (&metatree_lock);
   return type;
 }
 
@@ -1506,7 +1506,7 @@ meta_tree_get_last_changed (MetaTree *tree,
   gpointer value;
   guint64 res, mtime;
 
-  g_static_rw_lock_reader_lock (&metatree_lock);
+  g_rw_lock_reader_lock (&metatree_lock);
 
   new_path = meta_journal_reverse_map_path_and_key (tree->journal,
 						    path,
@@ -1526,7 +1526,7 @@ meta_tree_get_last_changed (MetaTree *tree,
   g_free (new_path);
 
  out:
-  g_static_rw_lock_reader_unlock (&metatree_lock);
+  g_rw_lock_reader_unlock (&metatree_lock);
 
   return res;
 }
@@ -1543,7 +1543,7 @@ meta_tree_lookup_string (MetaTree   *tree,
   char *new_path;
   char *res;
 
-  g_static_rw_lock_reader_lock (&metatree_lock);
+  g_rw_lock_reader_lock (&metatree_lock);
 
   new_path = meta_journal_reverse_map_path_and_key (tree->journal,
 						    path,
@@ -1572,7 +1572,7 @@ meta_tree_lookup_string (MetaTree   *tree,
     res = g_strdup (verify_string (tree, ent->value));
 
  out:
-  g_static_rw_lock_reader_unlock (&metatree_lock);
+  g_rw_lock_reader_unlock (&metatree_lock);
 
   return res;
 }
@@ -1621,7 +1621,7 @@ meta_tree_lookup_stringv   (MetaTree                         *tree,
   char **res;
   guint32 num_strings, i;
 
-  g_static_rw_lock_reader_lock (&metatree_lock);
+  g_rw_lock_reader_lock (&metatree_lock);
 
   new_path = meta_journal_reverse_map_path_and_key (tree->journal,
 						    path,
@@ -1658,7 +1658,7 @@ meta_tree_lookup_stringv   (MetaTree                         *tree,
     }
 
  out:
-  g_static_rw_lock_reader_unlock (&metatree_lock);
+  g_rw_lock_reader_unlock (&metatree_lock);
 
   return res;
 }
@@ -1876,7 +1876,7 @@ meta_tree_enumerate_dir (MetaTree                         *tree,
   MetaFileDir *dir;
   char *res_path;
 
-  g_static_rw_lock_reader_lock (&metatree_lock);
+  g_rw_lock_reader_lock (&metatree_lock);
 
   data.children = children =
     g_hash_table_new_full (g_str_hash,
@@ -1922,7 +1922,7 @@ meta_tree_enumerate_dir (MetaTree                         *tree,
  out:
   g_free (res_path);
   g_hash_table_destroy (children);
-  g_static_rw_lock_reader_unlock (&metatree_lock);
+  g_rw_lock_reader_unlock (&metatree_lock);
 }
 
 typedef struct {
@@ -2116,7 +2116,7 @@ meta_tree_enumerate_keys (MetaTree                         *tree,
   GHashTableIter iter;
   char *res_path;
 
-  g_static_rw_lock_reader_lock (&metatree_lock);
+  g_rw_lock_reader_lock (&metatree_lock);
 
   keydata.keys = keys =
     g_hash_table_new_full (g_str_hash,
@@ -2170,7 +2170,7 @@ meta_tree_enumerate_keys (MetaTree                         *tree,
  out:
   g_free (res_path);
   g_hash_table_destroy (keys);
-  g_static_rw_lock_reader_unlock (&metatree_lock);
+  g_rw_lock_reader_unlock (&metatree_lock);
 }
 
 
@@ -2371,9 +2371,9 @@ meta_tree_flush (MetaTree *tree)
 {
   gboolean res;
 
-  g_static_rw_lock_writer_lock (&metatree_lock);
+  g_rw_lock_writer_lock (&metatree_lock);
   res = meta_tree_flush_locked (tree);
-  g_static_rw_lock_writer_unlock (&metatree_lock);
+  g_rw_lock_writer_unlock (&metatree_lock);
   return res;
 }
 
@@ -2386,7 +2386,7 @@ meta_tree_unset (MetaTree                         *tree,
   guint64 mtime;
   gboolean res;
 
-  g_static_rw_lock_writer_lock (&metatree_lock);
+  g_rw_lock_writer_lock (&metatree_lock);
 
   if (tree->journal == NULL ||
       !tree->journal->journal_valid)
@@ -2412,7 +2412,7 @@ meta_tree_unset (MetaTree                         *tree,
   g_string_free (entry, TRUE);
 
  out:
-  g_static_rw_lock_writer_unlock (&metatree_lock);
+  g_rw_lock_writer_unlock (&metatree_lock);
   return res;
 }
 
@@ -2426,7 +2426,7 @@ meta_tree_set_string (MetaTree                         *tree,
   guint64 mtime;
   gboolean res;
 
-  g_static_rw_lock_writer_lock (&metatree_lock);
+  g_rw_lock_writer_lock (&metatree_lock);
 
   if (tree->journal == NULL ||
       !tree->journal->journal_valid)
@@ -2452,7 +2452,7 @@ meta_tree_set_string (MetaTree                         *tree,
   g_string_free (entry, TRUE);
 
  out:
-  g_static_rw_lock_writer_unlock (&metatree_lock);
+  g_rw_lock_writer_unlock (&metatree_lock);
   return res;
 }
 
@@ -2466,7 +2466,7 @@ meta_tree_set_stringv (MetaTree                         *tree,
   guint64 mtime;
   gboolean res;
 
-  g_static_rw_lock_writer_lock (&metatree_lock);
+  g_rw_lock_writer_lock (&metatree_lock);
 
   if (tree->journal == NULL ||
       !tree->journal->journal_valid)
@@ -2492,7 +2492,7 @@ meta_tree_set_stringv (MetaTree                         *tree,
   g_string_free (entry, TRUE);
 
  out:
-  g_static_rw_lock_writer_unlock (&metatree_lock);
+  g_rw_lock_writer_unlock (&metatree_lock);
   return res;
 }
 
@@ -2504,7 +2504,7 @@ meta_tree_remove (MetaTree *tree,
   guint64 mtime;
   gboolean res;
 
-  g_static_rw_lock_writer_lock (&metatree_lock);
+  g_rw_lock_writer_lock (&metatree_lock);
 
   if (tree->journal == NULL ||
       !tree->journal->journal_valid)
@@ -2530,7 +2530,7 @@ meta_tree_remove (MetaTree *tree,
   g_string_free (entry, TRUE);
 
  out:
-  g_static_rw_lock_writer_unlock (&metatree_lock);
+  g_rw_lock_writer_unlock (&metatree_lock);
   return res;
 }
 
@@ -2543,7 +2543,7 @@ meta_tree_copy (MetaTree                         *tree,
   guint64 mtime;
   gboolean res;
 
-  g_static_rw_lock_writer_lock (&metatree_lock);
+  g_rw_lock_writer_lock (&metatree_lock);
 
   if (tree->journal == NULL ||
       !tree->journal->journal_valid)
@@ -2569,7 +2569,7 @@ meta_tree_copy (MetaTree                         *tree,
   g_string_free (entry, TRUE);
 
  out:
-  g_static_rw_lock_writer_unlock (&metatree_lock);
+  g_rw_lock_writer_unlock (&metatree_lock);
   return res;
 }
 
diff --git a/monitor/proxy/gvfsproxyvolumemonitordaemon.c b/monitor/proxy/gvfsproxyvolumemonitordaemon.c
index 4be64e0..fe2f1a7 100644
--- a/monitor/proxy/gvfsproxyvolumemonitordaemon.c
+++ b/monitor/proxy/gvfsproxyvolumemonitordaemon.c
@@ -2050,7 +2050,6 @@ g_vfs_proxy_volume_monitor_daemon_init (void)
   textdomain (GETTEXT_PACKAGE);
 
   dbus_threads_init_default ();
-  g_thread_init (NULL);
   g_type_init ();
 }
 
-- 
1.7.6.5