mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 09:18:11 +02:00
[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.
This commit is contained in:
parent
71e4f7e3a1
commit
fd1f3c27e0
1 changed files with 4 additions and 1 deletions
|
|
@ -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"
|
||||
)
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue