aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2023-11-15 15:04:18 -0600
committerNathan Bossart <nathan@postgresql.org>2023-11-15 15:04:43 -0600
commit231a445ea31d12d27d6d7ce93eb7c2eec5bb8a09 (patch)
treef65ca0aeb3b5a0f9385452ec4ab1046fde4a68b0 /src/include
parent7836f6838d8c5c976fc4ee0dffd02ecd3ae7d106 (diff)
downloadpostgresql-231a445ea31d12d27d6d7ce93eb7c2eec5bb8a09.tar.gz
postgresql-231a445ea31d12d27d6d7ce93eb7c2eec5bb8a09.zip
Fix fallback implementation for pg_atomic_test_set_flag().
The fallback implementation of pg_atomic_test_set_flag() that uses atomic-exchange gives pg_atomic_exchange_u32_impl() an extra argument. This issue has been present since the introduction of the atomics API in commit b64d92f1a5. Reviewed-by: Andres Freund Discussion: https://postgr.es/m/20231114035439.GA1809032%40nathanxps13 Backpatch-through: 12
Diffstat (limited to 'src/include')
-rw-r--r--src/include/port/atomics/generic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/port/atomics/generic.h b/src/include/port/atomics/generic.h
index d60a0d9e7fc..c8983500e94 100644
--- a/src/include/port/atomics/generic.h
+++ b/src/include/port/atomics/generic.h
@@ -83,7 +83,7 @@ pg_atomic_init_flag_impl(volatile pg_atomic_flag *ptr)
static inline bool
pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr)
{
- return pg_atomic_exchange_u32_impl(ptr, &value, 1) == 0;
+ return pg_atomic_exchange_u32_impl(ptr, 1) == 0;
}
#define PG_HAVE_ATOMIC_UNLOCKED_TEST_FLAG