summaryrefslogtreecommitdiff
path: root/src/cairo-atomic.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2010-04-28 16:23:15 +0200
committerAndrea Canciani <ranma42@gmail.com>2010-04-29 10:52:47 +0200
commitd66b1ca1cfda64088521581bc2bd494bff9f5d23 (patch)
tree847df908155c71d928dd6690399ff535af2d95e8 /src/cairo-atomic.c
parenta0bf424b820b404947671b56f357a2cef71640fb (diff)
downloadcairo-d66b1ca1cfda64088521581bc2bd494bff9f5d23.tar.gz
atomic: Separate bool and old-value compare-and-exchange
Some implementations only offer one version of compare-and-exchange, thus we expose both through cairo-atomic, implementing what is missing through appropriate fallbacks. *_cmpxchg() now return a boolean (this unbreaks _cairo_atomic_uint_cmpxchg) *_cmpxchg_return_old() return the old value Code is updated everywhere to reflect this, by using *_cmpxchg() wherever the returned value was only tested to check if the exchange had really taken place. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-atomic.c')
-rw-r--r--src/cairo-atomic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-atomic.c b/src/cairo-atomic.c
index 60d8f0021..4347be12d 100644
--- a/src/cairo-atomic.c
+++ b/src/cairo-atomic.c
@@ -62,7 +62,7 @@ _cairo_atomic_int_dec_and_test (int *x)
}
int
-_cairo_atomic_int_cmpxchg (int *x, int oldv, int newv)
+_cairo_atomic_int_cmpxchg_return_old_impl (int *x, int oldv, int newv)
{
int ret;
@@ -76,7 +76,7 @@ _cairo_atomic_int_cmpxchg (int *x, int oldv, int newv)
}
void *
-_cairo_atomic_ptr_cmpxchg (void **x, void *oldv, void *newv)
+_cairo_atomic_ptr_cmpxchg_return_old_impl (void **x, void *oldv, void *newv)
{
void *ret;