diff options
| author | Andres Freund <andres@anarazel.de> | 2025-12-03 18:38:20 -0500 |
|---|---|---|
| committer | Andres Freund <andres@anarazel.de> | 2025-12-03 18:38:20 -0500 |
| commit | 7902a47c20b1d5c0b7d20071f9ada6a0185bf39b (patch) | |
| tree | 75281e6f942ae18501709e193ded80a7ffef97cf /src/include/port/atomics/generic.h | |
| parent | 156680055dc523425f28ff5e61acf0f5bc99294b (diff) | |
Add pg_atomic_unlocked_write_u64
The 64bit equivalent of pg_atomic_unlocked_write_u32(), to be used in an
upcoming patch converting BufferDesc.state into a 64bit atomic.
Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/fvfmkr5kk4nyex56ejgxj3uzi63isfxovp2biecb4bspbjrze7@az2pljabhnff
Diffstat (limited to 'src/include/port/atomics/generic.h')
| -rw-r--r-- | src/include/port/atomics/generic.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/port/atomics/generic.h b/src/include/port/atomics/generic.h index 6b61a7b5416..00aa152f908 100644 --- a/src/include/port/atomics/generic.h +++ b/src/include/port/atomics/generic.h @@ -297,6 +297,15 @@ pg_atomic_write_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 val) #endif /* PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY && !PG_HAVE_ATOMIC_U64_SIMULATION */ #endif /* PG_HAVE_ATOMIC_WRITE_U64 */ +#ifndef PG_HAVE_ATOMIC_UNLOCKED_WRITE_U64 +#define PG_HAVE_ATOMIC_UNLOCKED_WRITE_U64 +static inline void +pg_atomic_unlocked_write_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 val) +{ + ptr->value = val; +} +#endif + #ifndef PG_HAVE_ATOMIC_READ_U64 #define PG_HAVE_ATOMIC_READ_U64 |
