postgresql/src/include/storage
Tom Lane 5ecf836e9b Allow use of __sync_lock_test_and_set for spinlocks on any machine.
If we have no special-case code in s_lock.h for the current platform,
but the compiler has __sync_lock_test_and_set, use that instead of
failing.  It's unlikely that anybody's __sync_lock_test_and_set
would be so awful as to be worse than our semaphore-based fallback,
but if it is, they can (continue to) use --disable-spinlocks.

This allows removal of the RISC-V special case installed by commit
c32fcac56, which generated exactly the same code but only on that
platform.  Usefully, the RISC-V buildfarm animals should now test
at least the int variant of this patch.

I've manually tested both variants on ARM by dint of removing the
ARM-specific stanza.  We don't want to drop that, because it already
has some special knowledge and is likely to grow more over time.
Likewise, this is not meant to preclude installing special cases
for other arches if that proves worthwhile.

Per discussion of a request to install the same code for loongarch64.
Like the previous patch, we might as well back-patch to supported
branches.

Discussion: https://postgr.es/m/761ac43d44b84d679ba803c2bd947cc0@HSMAILSVR04.hs.handsome.com.cn
2022-11-02 17:37:26 -04:00
..
.gitignore When trace_lwlocks is used, identify individual lwlocks by name. 2015-09-11 14:01:39 -04:00
backendid.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
barrier.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
block.h Fix bogus casting in BlockIdGetBlockNumber(). 2022-03-03 19:03:46 -05:00
buf.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
buf_internals.h C comment: correct use of 64-"byte" cache line size 2020-09-04 13:27:52 -04:00
buffile.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
bufmgr.h Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:13 -07:00
bufpage.h Extend PageIsVerified() to handle more custom options 2020-11-02 10:41:30 +09:00
checksum.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
checksum_impl.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
condition_variable.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
copydir.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
dsm.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
dsm_impl.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
fd.h Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
freespace.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
fsm_internals.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
indexfsm.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
ipc.h Consistently test for in-use shared memory. 2019-04-12 22:36:38 -07:00
item.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
itemid.h Standardize ItemIdData terminology. 2019-05-13 15:53:39 -07:00
itemptr.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
large_object.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
latch.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
lmgr.h Prevent concurrent SimpleLruTruncate() for any given SLRU. 2020-08-15 10:15:56 -07:00
lock.h Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions. 2021-10-23 18:36:42 -07:00
lockdefs.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
lwlock.h Fix lock assertions in dshash.c. 2022-07-11 15:51:47 +12:00
md.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
off.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_sema.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_shmem.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pmsignal.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
predicate.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
predicate_internals.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
proc.h Rethink the delay-checkpoint-end mechanism in the back-branches. 2022-04-14 11:10:13 -04:00
procarray.h Rethink the delay-checkpoint-end mechanism in the back-branches. 2022-04-14 11:10:13 -04:00
proclist.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
proclist_types.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
procsignal.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
reinit.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
relfilenode.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
s_lock.h Allow use of __sync_lock_test_and_set for spinlocks on any machine. 2022-11-02 17:37:26 -04:00
sharedfileset.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
shm_mq.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
shm_toc.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
shmem.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
sinval.h Remove superfluous newlines in function prototypes. 2019-07-31 00:07:09 -07:00
sinvaladt.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
smgr.h Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:13 -07:00
spin.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
standby.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
standbydefs.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
sync.h Fix assorted inconsistencies. 2019-06-08 08:16:38 +05:30