Replace individual global-lock variables with an array of DBusRMutex *
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 16 Apr 2013 14:39:54 +0000 (15:39 +0100)
committerAnas Nashif <anas.nashif@intel.com>
Wed, 19 Jun 2013 10:07:34 +0000 (06:07 -0400)
commite6967dd7cdbb14fb9d0039954d9504c8dac5b0a4
tree004962e55a53a11f82a8a25bb198454460e246af
parent0a72312c45b1e1c74c9367e91189a67737892ae1
Replace individual global-lock variables with an array of DBusRMutex *

This means we can use a much simpler code structure in data-slot
allocators: instead of giving them a DBusRMutex ** at first-allocation,
we can just give them an index into the array, which can be done
statically.

It doesn't make us any more thread-safe-by-default - the mutexes will
only actually be used if threads were already initialized - but it's
substantially better than nothing.

These locks really do have to be recursive: for instance,
internal_bus_get() calls dbus_bus_register() under the bus lock,
and dbus_bus_register() can call _dbus_connection_close_possibly_shared(),
which takes the bus lock.

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>
Reviewed-by: Anas Nashif <anas.nashif@intel.com>
Applied-upstream: 1.7.6, commit:c80c20af46c5f43dcbe672f2c6d8aec0e7f2bbd6
Bug-Tizen: TZPC-1971
Change-Id: I22a31a9278b5f9c88557c54723f86827a91de818
15 files changed:
Doxyfile.in
cmake/Doxyfile.cmake
dbus/dbus-bus.c
dbus/dbus-connection.c
dbus/dbus-dataslot.c
dbus/dbus-dataslot.h
dbus/dbus-internals.c
dbus/dbus-internals.h
dbus/dbus-list.c
dbus/dbus-memory.c
dbus/dbus-message.c
dbus/dbus-pending-call.c
dbus/dbus-server.c
dbus/dbus-sysdeps.c
dbus/dbus-threads.c