]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use __sync_lock_test_and_set() for spinlocks on ARM, if available.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 7 Jan 2012 20:39:05 +0000 (15:39 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 7 Jan 2012 20:39:05 +0000 (15:39 -0500)
commitbb65cb8cdf864e61bc939d3c4b28bbd43d926700
tree2329a2e2d73b9c4a019d2974d5d9df2f13246638
parent1f996adab3ec30c12b5ffaa418045e4b2c93d818
Use __sync_lock_test_and_set() for spinlocks on ARM, if available.

Historically we've used the SWPB instruction for TAS() on ARM, but this
is deprecated and not available on ARMv6 and later.  Instead, make use
of a GCC builtin if available.  We'll still fall back to SWPB if not,
so as not to break existing ports using older GCC versions.

Eventually we might want to try using __sync_lock_test_and_set() on some
other architectures too, but for now that seems to present only risk and
not reward.

Back-patch to all supported versions, since people might want to use any
of them on more recent ARM chips.

Martin Pitt
configure
configure.in
src/include/pg_config.h.in
src/include/storage/s_lock.h