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)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 17 Jun 2013 16:01:22 +0000 (17:01 +0100)
commit08391b14616c248458e838691d068aa48dc70d18
treefca36a41af202fcf167e4643282e253e1f6ff173
parent2b3272c75ae48c93911bd6f656965cf77d6de3e8
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>
dbus/dbus-threads.c