mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-13 01:55:59 +00:00
31 lines
413 B
C++
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
|