diff options
| author | Max Bernstein <rubybugs@bernsteinbear.com> | 2025-11-24 12:28:30 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-24 15:28:30 -0500 |
| commit | 8a68dc7bdd3d1c97677a6633a4f2b5e524c492ae (patch) | |
| tree | 6aeba9bfe65a8db038e07e0f3e98e3c0d13b4327 /ruby_atomic.h | |
| parent | aeb7689e696540f3f96bad87efc91ba2b4187c99 (diff) | |
Revert "Fix stdatomic case in `rbimpl_atomic_u64_fetch_add`" (#15311)
This reverts commit d3b6f835d565ec1590059773fc87589ddf8adc37.
This broke the Docker builds and presumably also 32-bit machines that
don't already have libatomic installed.
Diffstat (limited to 'ruby_atomic.h')
| -rw-r--r-- | ruby_atomic.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ruby_atomic.h b/ruby_atomic.h index 3a541d9208..c194f7ec3b 100644 --- a/ruby_atomic.h +++ b/ruby_atomic.h @@ -2,9 +2,6 @@ #define INTERNAL_ATOMIC_H #include "ruby/atomic.h" -#ifdef HAVE_STDATOMIC_H -# include <stdatomic.h> -#endif #define RUBY_ATOMIC_VALUE_LOAD(x) rbimpl_atomic_value_load(&(x), RBIMPL_ATOMIC_SEQ_CST) @@ -79,9 +76,9 @@ rbimpl_atomic_u64_fetch_add(volatile rbimpl_atomic_uint64_t *ptr, uint64_t val) return InterlockedExchangeAdd64((volatile LONG64 *)ptr, val); #elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx)) return atomic_add_64_nv(ptr, val) - val; -#elif defined(HAVE_STDATOMIC_H) - return atomic_fetch_add_explicit((_Atomic uint64_t *)ptr, val, memory_order_seq_cst); #else + // TODO: stdatomic + // Fallback using mutex for platforms without 64-bit atomics static rb_native_mutex_t lock = RB_NATIVE_MUTEX_INITIALIZER; rb_native_mutex_lock(&lock); |
