Always initialize threading before allocating a dynamic mutex

System Internals / DBus - Simon McVittie [collabora.co.uk] - 17 June 2013 11:01 UTC

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

08391b1 Always initialize threading before allocating a dynamic mutex
dbus/dbus-threads.c | 300 ++++++++++-----------------------------------------
1 file changed, 56 insertions(+), 244 deletions(-)

Upstream: cgit.freedesktop.org


  • Share