~timo-jyrinki/gconf/ubuntu.support-s-to-as-migrations

« back to all changes in this revision

Viewing changes to debian/patches/call-dbus_g_thread_init.patch

  • Committer: timo.jyrinki at canonical
  • Date: 2012-09-14 13:50:07 UTC
  • Revision ID: timo.jyrinki@canonical.com-20120914135007-9z0hrc13o9u3jrgh
(add debian/patches/call-dbus_g_thread_init.patch itself)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Author: Chow Loong Jin <hyperair@debian.org>
 
2
Description: Call dbus_g_thread_init before calling any dbus functions
 
3
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1048341
 
4
Index: gconf/gconf/gconf-dbus.c
 
5
===================================================================
 
6
--- gconf.orig/gconf/gconf-dbus.c       2012-09-11 09:54:10.056848441 +0800
 
7
+++ gconf/gconf/gconf-dbus.c    2012-09-11 10:07:03.967826677 +0800
 
8
@@ -396,6 +396,13 @@
 
9
       return FALSE;
 
10
     }
 
11
 
 
12
+  /* Initialize DBus Glib for multithreading -- this fixes race conditions when
 
13
+     multi-threaded applications use gconf. Additionally, although the API
 
14
+     documentation says that dbus_g_thread_init() may only be called once, it is
 
15
+     actually really a wrapper for dbus_threads_init_default() which casn be
 
16
+     called as many times as necessary. */
 
17
+  dbus_g_thread_init ();
 
18
+
 
19
   dbus_error_init (&error);
 
20
 
 
21
   global_conn = dbus_bus_get_private (DBUS_BUS_SESSION, &error);