Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Sep 26, 2024
1 parent 3a91b3b commit 22fe979
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/ylt/metric/thread_local_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static value_type inc_impl(std::atomic<value_type> &obj, value_type value) {
std::atomic<value_type>{}.fetch_add(value_type{});
}) {
value_type v = obj.load(std::memory_order::relaxed);
while (!atomic_compare_exchange_weak(v, v + value))
while (!std::atomic_compare_exchange_weak(&obj, v, v + value))
;
return v;
}
Expand All @@ -35,7 +35,7 @@ static value_type dec_impl(std::atomic<value_type> &obj, value_type value) {
std::atomic<value_type>{}.fetch_add(value_type{});
}) {
value_type v = obj.load(std::memory_order::relaxed);
while (!obj.compare_exchange_weak(v, v - value))
while (!std::atomic_compare_exchange_weak(&obj, v, v - value))
;
return v;
}
Expand Down

0 comments on commit 22fe979

Please sign in to comment.