diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-21 09:17:56 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-21 09:23:15 +0100 |
commit | fd1f3c27e093b1f51f0c1a381cc02cbf8f9889d7 (patch) | |
tree | 1452cbc0e96cfc8e14702612d5076840f17a5f85 /build/aclocal.cairo.m4 | |
parent | 71e4f7e3a10e6c9794360473d0114b27b42bcead (diff) |
[configure] Check for atomic xchg.
Bug 18140 identifies a case where we have an atomic increment, but not an
atomic exchange. We need both to implement atomic reference counting, so
add a second check to detect whether __sync_val_compare_and_swap
generates a non-atomic instruction.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18140.
Diffstat (limited to 'build/aclocal.cairo.m4')
-rw-r--r-- | build/aclocal.cairo.m4 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/build/aclocal.cairo.m4 b/build/aclocal.cairo.m4 index 8292e8e2..f00b137f 100644 --- a/build/aclocal.cairo.m4 +++ b/build/aclocal.cairo.m4 @@ -101,7 +101,10 @@ AC_DEFUN([CAIRO_CHECK_NATIVE_ATOMIC_PRIMITIVES], [ cairo_cv_atomic_primitives="none" - AC_TRY_LINK([int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }], [], + AC_TRY_LINK([ +int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); } +int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); } +], [], cairo_cv_atomic_primitives="Intel" ) ]) |