Skip to content

Commit

Permalink
fix mem order
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Jan 24, 2025
1 parent bc3bfd6 commit db5d03f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/ylt/coro_io/coro_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ inline async_simple::coro::Lazy<ret_type> async_io(IO_func io_func,
if (auto ptr = weak_lock.lock(); ptr) {
bool expected = false;
if (!ptr->compare_exchange_strong(
expected, true, std::memory_order_release)) {
expected, true, std::memory_order_acq_rel)) {
detail::cancel(obj);
}
}
Expand All @@ -266,7 +266,7 @@ inline async_simple::coro::Lazy<ret_type> async_io(IO_func io_func,
});
bool expected = false;
if (!lock->compare_exchange_strong(expected, true,
std::memory_order_release)) {
std::memory_order_acq_rel)) {
detail::cancel(obj);
}
lock = nullptr;
Expand Down

0 comments on commit db5d03f

Please sign in to comment.