Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit 784af6c

Browse files
committedJul 3, 2017
Remove SpinLock
1 parent eb43779 commit 784af6c

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed
 

‎libdevcore/Guards.h

-12
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ struct GenericGuardBool: GuardType
3939
bool b = true;
4040
};
4141

42-
/** @brief Simple lock that waits for release without making context switch */
43-
class SpinLock
44-
{
45-
public:
46-
SpinLock() { m_lock.clear(); }
47-
void lock() { while (m_lock.test_and_set(std::memory_order_acquire)) {} }
48-
void unlock() { m_lock.clear(std::memory_order_release); }
49-
private:
50-
std::atomic_flag m_lock;
51-
};
52-
using SpinGuard = std::lock_guard<SpinLock>;
53-
5442
template <class N>
5543
class Notified
5644
{

0 commit comments

Comments
 (0)
This repository has been archived.