Skip to content

Commit 5a3673c

Browse files
committed
SpinLock.hpp
1 parent 3b4dba1 commit 5a3673c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

section5/SpinLock.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SpinLock final
3434

3535
bool try_lock() noexcept
3636
{
37-
return m_lock.test_and_set();
37+
return !m_lock.test_and_set();
3838
}
3939

4040
void unlock() noexcept

0 commit comments

Comments
 (0)