Always initialize threading before allocating a dynamic mutex
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 16 Apr 2013 15:37:51 +0000 (16:37 +0100)
committerAnas Nashif <anas.nashif@intel.com>
Wed, 19 Jun 2013 10:07:34 +0000 (06:07 -0400)
commit6cdd87b99313d27fd8f923f477702a193c150c85
tree26b67a4078a605fe03101073380f3643d89edf2d
parentd1228cc870b0a3c17bb3db2fd9e406aa4f7986f6
Always initialize threading before allocating a dynamic mutex

Dynamic allocation of mutexes can fail anyway, so this is easy.

Justification for not keeping the dummy mutex code-paths, even as an
opt-in thing for processes known to be high-performance and
single-threaded: real mutexes only cut the throughput of
test/dbus-daemon.c by a couple of percent on my laptop (from around
6700 to around 6600 messages per second), and libdbus crashes caused
by not calling dbus_threads_init_default() are sufficiently widespread
that they're wasting a lot of everyone's time.

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: Anas Nashif <anas.nashif@intel.com>
Bug-Tizen: TZPC-1971
Applied-upstream: 1.7.6, commit:08391b14616c248458e838691d068aa48dc70d18
Change-Id: I62e4fc541f6868ef44dc0654337b895e5392c16e
dbus/dbus-threads.c