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)
committerAnas Nashif <anas.nashif@intel.com>
Wed, 19 Jun 2013 10:07:33 +0000 (06:07 -0400)
commit2f2501c854a3c615a0a67aec7ebb8f7202002216
treef9e47d8b5d6e0a9e51572249ced8925d498f0e4b
parenteca0cd54f16c94e36722735ac8d111da671b8185
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>
Applied-upstream: 1.7.4, commit:17a23d08b51cf21a2110047649a86445e99e2b3f
Bug-Tizen: TZPC-1971
Reviewed-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: Id6aa81b7d553965c4c6f511e2410673c2f222a66
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