mason/src/atomicmutex.cpp

14 lines
199 B
C++

#include "atomicmutex.h"
AtomicMutex::AtomicMutex():
flag()
{}
void AtomicMutex::lock() noexcept {
while (flag.test_and_set());
}
void AtomicMutex::unlock() noexcept {
flag.clear();
}