Add mutex implementation using std::atomic_flag

This commit is contained in:
Henrik Stickann
2022-04-09 21:23:02 +02:00
parent 3abe36ec81
commit d7bd511c70
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#ifndef STA_ATOMIC_MUTEX_HPP
#define STA_ATOMIC_MUTEX_HPP
#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_MUTEX_HPP