diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-04-16 15:39:54 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-06-17 16:53:51 +0100 |
commit | c80c20af46c5f43dcbe672f2c6d8aec0e7f2bbd6 (patch) | |
tree | b88990c3946b35408a7463a3e51296800bd8f389 /dbus/dbus-bus.c | |
parent | 7e9ee6c82e42ffa3f6e4e69e077f72df6f4107db (diff) | |
download | dbus-c80c20af46c5f43dcbe672f2c6d8aec0e7f2bbd6.tar.gz |
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>
Diffstat (limited to 'dbus/dbus-bus.c')
-rw-r--r-- | dbus/dbus-bus.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c index 6f81c74a..4a6ffb1e 100644 --- a/dbus/dbus-bus.c +++ b/dbus/dbus-bus.c @@ -95,19 +95,6 @@ static DBusBusType activation_bus_type = DBUS_BUS_STARTER; static dbus_bool_t initialized = FALSE; -/** - * Lock for globals in this file - */ -_DBUS_DEFINE_GLOBAL_LOCK (bus); - -/** - * Global lock covering all BusData on any connection. The bet is - * that some lock contention is better than more memory - * for a per-connection lock, but it's tough to imagine it mattering - * either way. - */ -_DBUS_DEFINE_GLOBAL_LOCK (bus_datas); - static void addresses_shutdown_func (void *data) { |