Skip to content

Commit

Permalink
Use acquire-release memory order for mutex::try_lock (#274)
Browse files Browse the repository at this point in the history
(cherry picked from commit 201fb02)
  • Loading branch information
louiswilliams authored and beef9999 committed Nov 23, 2023
1 parent 72f16d5 commit 49bc338
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion thread/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ R"(
{
thread* ptr = nullptr;
bool ret = owner.compare_exchange_strong(ptr, CURRENT,
std::memory_order_release, std::memory_order_relaxed);
std::memory_order_acq_rel, std::memory_order_relaxed);
return (int)ret - 1;
}
inline void do_mutex_unlock(mutex* m)
Expand Down

0 comments on commit 49bc338

Please sign in to comment.