summary refs log tree commit diff
path: root/pkgs/desktops/gnome-2/platform/libgnome/new-glib.patch
blob: ceabfbdd158e6c22df3070d302749fb6bf9c5fa8 (plain) (blame)
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
Porting libgnome to newer glib:
 * remove g_thread_init and g_thread_supported, which are longer needed
   https://developer.gnome.org/glib/2.36/glib-Deprecated-Thread-APIs.html#g-thread-init
 * replace GStaticRecMutex by GRecMutex
   https://developer.gnome.org/glib/2.36/glib-Deprecated-Thread-APIs.html#GStaticRecMutex

diff --git a/libgnome/gnome-i18n.c b/libgnome/gnome-i18n.c
index 531c56c..f13d61e 100644
--- a/libgnome/gnome-i18n.c
+++ b/libgnome/gnome-i18n.c
@@ -55,12 +55,14 @@
 const GList *
 gnome_i18n_get_language_list (const gchar *ignored)
 {
-  static GStaticRecMutex lang_list_lock = G_STATIC_REC_MUTEX_INIT;
+  static GRecMutex lang_list_lock;
+  g_rec_mutex_init (&lang_list_lock);
+
   static GList *list = NULL;
   const char * const* langs;
   int i;
 
-  g_static_rec_mutex_lock (&lang_list_lock);
+  g_rec_mutex_lock (&lang_list_lock);
 
   if (list == NULL) {
     langs = g_get_language_names ();
@@ -71,7 +73,7 @@ gnome_i18n_get_language_list (const gchar *ignored)
     list = g_list_reverse (list);
   }
 
-  g_static_rec_mutex_unlock (&lang_list_lock);
+  g_rec_mutex_unlock (&lang_list_lock);
 
   return list;
 }
diff --git a/libgnome/gnome-init.c b/libgnome/gnome-init.c
index fe3efd4..c6619af 100644
--- a/libgnome/gnome-init.c
+++ b/libgnome/gnome-init.c
@@ -115,9 +115,6 @@ gnome_bonobo_module_info_get (void)
 static void
 bonobo_activation_pre_args_parse (GnomeProgram *program, GnomeModuleInfo *mod_info)
 {
-        if (!g_thread_supported ())
-		g_thread_init (NULL);
-
 	if (!bonobo_activation_is_initialized ())
 		bonobo_activation_preinit (program, mod_info);
 }
diff --git a/libgnome/gnome-program.c b/libgnome/gnome-program.c
index 739765e..cd14999 100644
--- a/libgnome/gnome-program.c
+++ b/libgnome/gnome-program.c
@@ -1878,10 +1878,6 @@ gnome_program_init (const char *app_id, const char *app_version,
     GnomeProgram *program;
     va_list args;
 
-    /* g_thread_init() has to be the first GLib function called ever */
-    if (!g_threads_got_initialized)
-        g_thread_init (NULL);
-
     g_type_init ();
 
     va_start(args, first_property_name);