]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
dbus_threads_init: call _dbus_threads_init_platform_specific()
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 15 Apr 2013 12:54:39 +0000 (13:54 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 9 May 2013 09:33:38 +0000 (10:33 +0100)
This reverses the relationship between these two functions.
Previously, dbus_threads_init() wouldn't allocate dbus_cond_event_tls
on Windows, call check_monotonic_clock on Unix, or call
_dbus_check_setuid on Unix.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
dbus/dbus-sysdeps-pthread.c
dbus/dbus-sysdeps-thread-win.c
dbus/dbus-threads.c

index 439c9c62f74e9fbf8b1176e60967e20d522192d8..1344074e2652c3e8b9049cb1628e52590d7e0be0 100644 (file)
@@ -283,5 +283,6 @@ _dbus_threads_init_platform_specific (void)
    */
   check_monotonic_clock ();
   (void) _dbus_check_setuid ();
-  return dbus_threads_init (NULL);
+
+  return TRUE;
 }
index e30e7b87ed218ebc7fdd7dfd91fc31971bca91ad..4c4442a687ddf864ccf812a5eb9c903a496e9799 100644 (file)
@@ -269,6 +269,6 @@ _dbus_threads_init_platform_specific (void)
        return FALSE;
     }
 
-  return dbus_threads_init (NULL);
+  return TRUE;
 }
 
index b464629a062fe0ebd79141ede6fbd7002c752fe0..e7f2eb74a70e454852626fe67106609b9882ba5f 100644 (file)
@@ -584,7 +584,8 @@ dbus_threads_init (const DBusThreadFunctions *functions)
   if (thread_init_generation == _dbus_current_generation)
     return TRUE;
 
-  if (!init_locks ())
+  if (!_dbus_threads_init_platform_specific() ||
+      !init_locks ())
     return FALSE;
 
   thread_init_generation = _dbus_current_generation;
@@ -613,7 +614,7 @@ dbus_threads_init (const DBusThreadFunctions *functions)
 dbus_bool_t
 dbus_threads_init_default (void)
 {
-  return _dbus_threads_init_platform_specific ();
+  return dbus_threads_init (NULL);
 }
 
 
@@ -624,7 +625,7 @@ dbus_threads_init_default (void)
 dbus_bool_t
 _dbus_threads_init_debug (void)
 {
-  return _dbus_threads_init_platform_specific();
+  return dbus_threads_init (NULL);
 }
 
 #endif /* DBUS_BUILD_TESTS */