mason/src2/atomicmutex.cpp

14 lines
199 B
C++
Raw Normal View History

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