2022-04-10 20:44:44 +02:00

31 lines
413 B
C++

#ifndef STA_ATOMIC_MUTEX_HPP
#define STA_ATOMIC_MUTEX_HPP
#include <sta/config.hpp>
#ifdef STA_ATOMIC_ENABLE
#include <sta/mutex.hpp>
#include <atomic>
namespace sta
{
class AtomicMutex : public Mutex
{
public:
AtomicMutex();
void acquire() override;
void release() override;
private:
std::atomic_flag lock_;
};
} // namespace sta
#endif // STA_ATOMIC_ENABLE
#endif // STA_ATOMIC_MUTEX_HPP