Skip to content

Commit

Permalink
Merge pull request #18281 from shamser/issue31229
Browse files Browse the repository at this point in the history
HPCC-31229 RelaxedAtomic fetch_sub implementation wrong

Reviewed-By: Richard Chapman <[email protected]>
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Feb 9, 2024
2 parents 85ab0c9 + 5ee3d40 commit a98ef81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/jlib/jatomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RelaxedAtomic : public std::atomic<T>
inline T load(std::memory_order order = std::memory_order_relaxed) const noexcept { return BASE::load(order); }
inline T exchange(T _value, std::memory_order order = std::memory_order_relaxed) noexcept { return BASE::exchange(_value, order); }
inline T fetch_add(T _value, std::memory_order order = std::memory_order_relaxed) noexcept { return BASE::fetch_add(_value, order); }
inline T fetch_sub(T _value, std::memory_order order = std::memory_order_relaxed) noexcept { return BASE::fetch_add(_value, order); }
inline T fetch_sub(T _value, std::memory_order order = std::memory_order_relaxed) noexcept { return BASE::fetch_sub(_value, order); }
inline T add_fetch(T _value, std::memory_order order = std::memory_order_relaxed) noexcept { return ::add_fetch(*this, _value, order); }
inline T sub_fetch(T _value, std::memory_order order = std::memory_order_relaxed) noexcept { return ::sub_fetch(*this, _value, order); }
inline void store_max(T _value) noexcept { while (_value > load()) _value = BASE::exchange(_value, std::memory_order_acq_rel); }
Expand Down

0 comments on commit a98ef81

Please sign in to comment.