Skip to content

Commit 69c32b8

Browse files
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 b64d92f. Reviewed-by: Andres Freund Discussion: https://postgr.es/m/20231114035439.GA1809032%40nathanxps13 Backpatch-through: 12
1 parent 6a72c42 commit 69c32b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/include/port/atomics/generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pg_atomic_init_flag_impl(volatile pg_atomic_flag *ptr)
8383
static inline bool
8484
pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr)
8585
{
86-
return pg_atomic_exchange_u32_impl(ptr, &value, 1) == 0;
86+
return pg_atomic_exchange_u32_impl(ptr, 1) == 0;
8787
}
8888

8989
#define PG_HAVE_ATOMIC_UNLOCKED_TEST_FLAG

0 commit comments

Comments
 (0)