From 886d279cd1da7011fb0b9ede36860dadd7b97119 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 15 Apr 2013 13:54:39 +0100 Subject: [PATCH 2/8] dbus_threads_init: call _dbus_threads_init_platform_specific() 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. Signed-off-by: Simon McVittie --- dbus/dbus-sysdeps-pthread.c | 3 ++- dbus/dbus-sysdeps-thread-win.c | 2 +- dbus/dbus-threads.c | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dbus/dbus-sysdeps-pthread.c b/dbus/dbus-sysdeps-pthread.c index 439c9c6..1344074 100644 --- a/dbus/dbus-sysdeps-pthread.c +++ b/dbus/dbus-sysdeps-pthread.c @@ -283,5 +283,6 @@ _dbus_threads_init_platform_specific (void) */ check_monotonic_clock (); (void) _dbus_check_setuid (); - return dbus_threads_init (NULL); + + return TRUE; } diff --git a/dbus/dbus-sysdeps-thread-win.c b/dbus/dbus-sysdeps-thread-win.c index e30e7b8..4c4442a 100644 --- a/dbus/dbus-sysdeps-thread-win.c +++ b/dbus/dbus-sysdeps-thread-win.c @@ -269,6 +269,6 @@ _dbus_threads_init_platform_specific (void) return FALSE; } - return dbus_threads_init (NULL); + return TRUE; } diff --git a/dbus/dbus-threads.c b/dbus/dbus-threads.c index b464629..e7f2eb7 100644 --- a/dbus/dbus-threads.c +++ b/dbus/dbus-threads.c @@ -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 */ -- 1.7.10.4