From eaefe03a8891b84e3f9e1f99f9098d65567e3092 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 28 Oct 2006 01:41:37 +0000 Subject: 2006-10-27 Havoc Pennington * dbus/dbus-test.c: enclose more of the file in the DBUS_BUILD_TESTS check. * dbus/dbus-sysdeps-pthread.c (PTHREAD_CHECK): fix for DBUS_DISABLE_ASSERT case. * dbus/dbus-connection.c (dbus_connection_get_unix_user): document that it only works on the server side * dbus/dbus-bus.c: add a global lock covering the BusData we attach to each connection (internal_bus_get): lock our access to the BusData (dbus_bus_register): lock the entire registration process with _DBUS_LOCK(bus_datas). If we get the lock and registration is already complete, silently return (vs. previous behavior of aborting). (dbus_bus_set_unique_name): lock the BusData (dbus_bus_get_unique_name): lock the BusData --- dbus/dbus-internals.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dbus/dbus-internals.h') diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h index c0422c83..4d839241 100644 --- a/dbus/dbus-internals.h +++ b/dbus/dbus-internals.h @@ -287,21 +287,25 @@ extern int _dbus_current_generation; #define _DBUS_LOCK(name) _dbus_mutex_lock (_dbus_lock_##name) #define _DBUS_UNLOCK(name) _dbus_mutex_unlock (_dbus_lock_##name) +/* 1-5 */ _DBUS_DECLARE_GLOBAL_LOCK (list); _DBUS_DECLARE_GLOBAL_LOCK (connection_slots); _DBUS_DECLARE_GLOBAL_LOCK (pending_call_slots); _DBUS_DECLARE_GLOBAL_LOCK (server_slots); _DBUS_DECLARE_GLOBAL_LOCK (message_slots); +/* 5-10 */ _DBUS_DECLARE_GLOBAL_LOCK (atomic); _DBUS_DECLARE_GLOBAL_LOCK (bus); +_DBUS_DECLARE_GLOBAL_LOCK (bus_datas); _DBUS_DECLARE_GLOBAL_LOCK (shutdown_funcs); _DBUS_DECLARE_GLOBAL_LOCK (system_users); +/* 10-15 */ _DBUS_DECLARE_GLOBAL_LOCK (message_cache); _DBUS_DECLARE_GLOBAL_LOCK (shared_connections); _DBUS_DECLARE_GLOBAL_LOCK (win_fds); _DBUS_DECLARE_GLOBAL_LOCK (sid_atom_cache); _DBUS_DECLARE_GLOBAL_LOCK (machine_uuid); -#define _DBUS_N_GLOBAL_LOCKS (14) +#define _DBUS_N_GLOBAL_LOCKS (15) dbus_bool_t _dbus_threads_init_debug (void); -- cgit