diff options
author | Thomas Munro <tmunro@postgresql.org> | 2024-07-30 21:45:01 +1200 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2024-07-30 22:58:37 +1200 |
commit | e25626677f8076eb3ce94586136c5464ee154381 (patch) | |
tree | f03f87af97b998e2dd5aadcfe8a93a83a1ae716b /src/backend/port/atomics.c | |
parent | 1330843bb78e9d2422af2f2b9909b80732bd6fc0 (diff) |
Remove --disable-spinlocks.
A later change will require atomic support, so it wouldn't make sense
for a hypothetical new system not to be able to implement spinlocks.
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (concept, not the patch)
Reviewed-by: Andres Freund <andres@anarazel.de> (concept, not the patch)
Discussion: https://postgr.es/m/3351991.1697728588%40sss.pgh.pa.us
Diffstat (limited to 'src/backend/port/atomics.c')
-rw-r--r-- | src/backend/port/atomics.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/backend/port/atomics.c b/src/backend/port/atomics.c index 93789b4e058..cd7ede96726 100644 --- a/src/backend/port/atomics.c +++ b/src/backend/port/atomics.c @@ -57,17 +57,7 @@ pg_atomic_init_flag_impl(volatile pg_atomic_flag *ptr) StaticAssertDecl(sizeof(ptr->sema) >= sizeof(slock_t), "size mismatch of atomic_flag vs slock_t"); -#ifndef HAVE_SPINLOCKS - - /* - * NB: If we're using semaphore based TAS emulation, be careful to use a - * separate set of semaphores. Otherwise we'd get in trouble if an atomic - * var would be manipulated while spinlock is held. - */ - s_init_lock_sema((slock_t *) &ptr->sema, true); -#else SpinLockInit((slock_t *) &ptr->sema); -#endif ptr->value = false; } @@ -108,15 +98,7 @@ pg_atomic_init_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 val_) StaticAssertDecl(sizeof(ptr->sema) >= sizeof(slock_t), "size mismatch of atomic_uint32 vs slock_t"); - /* - * If we're using semaphore based atomic flags, be careful about nested - * usage of atomics while a spinlock is held. - */ -#ifndef HAVE_SPINLOCKS - s_init_lock_sema((slock_t *) &ptr->sema, true); -#else SpinLockInit((slock_t *) &ptr->sema); -#endif ptr->value = val_; } @@ -184,15 +166,7 @@ pg_atomic_init_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 val_) StaticAssertDecl(sizeof(ptr->sema) >= sizeof(slock_t), "size mismatch of atomic_uint64 vs slock_t"); - /* - * If we're using semaphore based atomic flags, be careful about nested - * usage of atomics while a spinlock is held. - */ -#ifndef HAVE_SPINLOCKS - s_init_lock_sema((slock_t *) &ptr->sema, true); -#else SpinLockInit((slock_t *) &ptr->sema); -#endif ptr->value = val_; } |