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 Nov 23, 2023
1 parent 36388e2 commit 9c64050
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 9c64050

Please sign in to comment.