dbus_threads_init_default, dbus_threads_init: be safe to call at any time
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 16 Apr 2013 11:07:23 +0000 (12:07 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 10 May 2013 10:35:08 +0000 (11:35 +0100)
commit17a23d08b51cf21a2110047649a86445e99e2b3f
tree127ee33f09bab2955a07fd22e81781f0f79a2720
parent863c989bb631d7063597db30fe8add3233cca7fd
dbus_threads_init_default, dbus_threads_init: be safe to call at any time

On Unix, we use a pthreads mutex, which can be allocated and
initialized in global memory.

On Windows, we use a CRITICAL_SECTION, together with a call to
InitializeCriticalSection() from the constructor of a global static
C++ object (thanks to Ralf Habacker for suggesting this approach).

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>
cmake/dbus/CMakeLists.txt
dbus/Makefile.am
dbus/dbus-init-win.cpp [new file with mode: 0644]
dbus/dbus-memory.c
dbus/dbus-sysdeps-pthread.c
dbus/dbus-sysdeps-thread-win.c
dbus/dbus-sysdeps-win.h
dbus/dbus-sysdeps.h
dbus/dbus-threads.c