14 lines
199 B
C++
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();
|
||
|
}
|