mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 08:48:00 +02:00
atomic: correct libatomic_ops version of _cairo_atomic_int_cmpxchg
AO_compare_and_swap_full() doesn't have the same semantic as _cairo_atomic_int_cmpxchg(). The former returns a TRUE on success FALSE otherwise while the later returns the atomic value.
This commit is contained in:
parent
a2254e5647
commit
ea39f0302a
1 changed files with 1 additions and 1 deletions
|
|
@ -91,7 +91,7 @@ typedef AO_t cairo_atomic_int_t;
|
|||
|
||||
# define _cairo_atomic_int_inc(x) ((void) AO_fetch_and_add1_full(x))
|
||||
# define _cairo_atomic_int_dec_and_test(x) (AO_fetch_and_sub1_full(x) == 1)
|
||||
# define _cairo_atomic_int_cmpxchg(x, oldv, newv) ((cairo_atomic_int_t) AO_compare_and_swap_full(x, oldv, newv))
|
||||
# define _cairo_atomic_int_cmpxchg(x, oldv, newv) ((cairo_atomic_int_t) AO_compare_and_swap_full(x, oldv, newv) ? oldv : *x)
|
||||
|
||||
#if SIZEOF_VOID_P==SIZEOF_INT
|
||||
typedef unsigned int cairo_atomic_intptr_t;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue