Skip to content

Commit

Permalink
thread: tries to fix spin-mutex/scoped-lock error
Browse files Browse the repository at this point in the history
  • Loading branch information
quesnel committed Mar 22, 2024
1 parent 3dabdad commit 0d650ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/include/irritator/thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ inline spin_lock::spin_lock(const spin_lock& /*other*/) noexcept

inline void spin_lock::lock() noexcept
{
while (!try_lock())
while (m_flag.test_and_set(std::memory_order_acquire))
m_flag.wait(true, std::memory_order_relaxed);
}

Expand Down

0 comments on commit 0d650ca

Please sign in to comment.