summaryrefslogtreecommitdiff
path: root/src/cairo-mutex-list-private.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-09-21 10:45:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-09-25 16:29:54 +0100
commit8b6c871c9084739460f1320cd36560a09477a83e (patch)
treed6f0259aaff65a247d97edb8bb557d5febdc2b5e /src/cairo-mutex-list-private.h
parent42de1a0a7f5cc10c2bad98ef69da302ed2a1ca84 (diff)
downloadcairo-8b6c871c9084739460f1320cd36560a09477a83e.tar.gz
[cairo-atomic] Introduce atomic ops.
Test for the availability of the Intel __sync_* atomic primitives and use them to define a few operations useful for reference counting - providing a generic interface that may be targeted at more architectures in the future. If no atomic primitives are available, use a mutex based variant. If the contention on that mutex is too high, we can consider using an array of mutexes using the address of the atomic variable as the hash.
Diffstat (limited to 'src/cairo-mutex-list-private.h')
-rw-r--r--src/cairo-mutex-list-private.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cairo-mutex-list-private.h b/src/cairo-mutex-list-private.h
index abb4a9a3d..996079749 100644
--- a/src/cairo-mutex-list-private.h
+++ b/src/cairo-mutex-list-private.h
@@ -46,6 +46,9 @@ CAIRO_MUTEX_DECLARE (_cairo_ft_unscaled_font_map_mutex);
CAIRO_MUTEX_DECLARE (_cairo_xlib_display_mutex);
#endif
+#ifndef CAIRO_HAS_ATOMIC_OPS
+CAIRO_MUTEX_DECLARE (_cairo_atomic_mutex);
+#endif
/* Undefine, to err on unintended inclusion */
#undef CAIRO_MUTEX_DECLARE