summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-internals.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-05-19 22:30:14 +0200
committerLennart Poettering <lennart@poettering.net>2009-05-20 02:09:32 +0200
commit9293e823767daee79386cc797510808f4eed01a3 (patch)
treeb1f482f0cdf51c1ef2d78931665db6a7175502a8 /dbus/dbus-internals.h
parent74bff5af804817372aece931c792b53c8ec534e1 (diff)
atomic: implement atomic operations based on gcc's __sync extension
Newer gccs and intel ccs support a __sync extension for making use of atomic operations. This patch replaces the handcrafted x86 atomic operation support with usage of __sync. __sync is supported by more processors and by more compilers than the old assembler code. Also, this extension has been available on gcc for quite a while now for x86, so replacing the old assembler code should only be a loss when very old compiilers are used.
Diffstat (limited to 'dbus/dbus-internals.h')
-rw-r--r--dbus/dbus-internals.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h
index 3e5f989d..835fe46a 100644
--- a/dbus/dbus-internals.h
+++ b/dbus/dbus-internals.h
@@ -294,18 +294,23 @@ _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);
+/* 10-14 */
_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);
+
+#if !DBUS_USE_SYNC
+_DBUS_DECLARE_GLOBAL_LOCK (atomic);
#define _DBUS_N_GLOBAL_LOCKS (15)
+#else
+#define _DBUS_N_GLOBAL_LOCKS (14)
+#endif
dbus_bool_t _dbus_threads_init_debug (void);