4 #include "AudioConfig.h"
6 #ifdef USE_STD_CONCURRENCY
20 virtual void lock() {}
21 virtual void unlock() {}
28 if (!lock_.exchange(
true, std::memory_order_acquire)) {
32 while (lock_.load(std::memory_order_relaxed)) {
44 return !lock_.load(std::memory_order_relaxed) &&
45 !lock_.exchange(
true, std::memory_order_acquire);
48 void unlock() { lock_.store(
false, std::memory_order_release); }
51 volatile std::atomic<bool> lock_ = {0};
54 #if defined(USE_STD_CONCURRENCY)
64 void lock()
override { std_mutex.lock(); }
65 void unlock()
override { std_mutex.unlock(); }