summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-threads.c
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-threads.c
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-threads.c')
-rw-r--r--dbus/dbus-threads.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dbus/dbus-threads.c b/dbus/dbus-threads.c
index 00c1a4b1..cb9c7237 100644
--- a/dbus/dbus-threads.c
+++ b/dbus/dbus-threads.c
@@ -424,7 +424,9 @@ init_locks (void)
LOCK_ADDR (pending_call_slots),
LOCK_ADDR (server_slots),
LOCK_ADDR (message_slots),
+#if !DBUS_USE_SYNC
LOCK_ADDR (atomic),
+#endif
LOCK_ADDR (bus),
LOCK_ADDR (bus_datas),
LOCK_ADDR (shutdown_funcs),