/** * @brief Atomic mutex implementation. * * Configuration: * STA_ATOMIC_ENABLE: Enable module */ #ifndef STA_ATOMIC_MUTEX_HPP #define STA_ATOMIC_MUTEX_HPP #include #ifdef STA_ATOMIC_ENABLE #include #include namespace sta { /** * @brief Implementation of `Mutex` interface using `std::atomic_flag`. */ class AtomicMutex : public Mutex { public: AtomicMutex(); void acquire() override; void release() override; private: std::atomic_flag lock_; /**< Atomic flag used as lock */ }; } // namespace sta #endif // STA_ATOMIC_ENABLE #endif // STA_ATOMIC_MUTEX_HPP