Age | Commit message (Collapse) | Author | Files | Lines |
|
Missing definition of _cairo_atomic_ptr_get() used in the fallbacks.
|
|
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>
|
|
_cairo_atomic_int_set() was only used in the definition of
CAIRO_REFERENCE_SET_VALUE, which was never used.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
I updated the Free Software Foundation address using the following script.
for i in $(git grep Temple | cut -d: -f1 )
do
sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
|
|
|
|
Fix an implicit pointer/integer cast in _cairo_atomic_ptr_cmpxchg()
when building with LLVM/clang.
The Intel synchronization primitives __sync_val_compare_and_swap()
are only defined by Intel for types int, long, long long and their
unsigned variants. This patch uses one of those for
_cairo_atomic_ptr_cmpxchg() instead of relying on a gcc extension of
__sync_val_compare_and_swap() to pointer types.
|
|
To handle those CPUs where we do not have an atomic cmpxchg.
|
|
This is more robust to cases where people want to assign 0 to those variables.
(win32/alternate build systems, etc)
|
|
|
|
The atomic get/set depend upon NEED_MEMORY_BARRIER which is separate
from HAVE_ATOMIC_OPS.
|
|
Since the objects can be shared and may be in use simultaneously across
multiple threads, setting the status needs to be atomic. We use a
locked compare and exchange in order to avoid overwriting an existing
error - that is we use an atomic operation that only sets the new status
value if the current value is CAIRO_STATUS_SUCCESS.
|
|
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.
|