Add atomic signal implementation

This commit is contained in:
Henrik Stickann
2022-04-10 15:24:22 +02:00
parent b369f34092
commit 46cd2417e3
2 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#ifndef STA_ATOMIC_SIGNAL_HPP
#define STA_ATOMIC_SIGNAL_HPP
#include <sta/signal.hpp>
#include <atomic>
namespace sta
{
class AtomicSignal : public Signal
{
public:
AtomicSignal();
void notify() override;
bool peek() override;
bool test() override;
void wait() override;
private:
std::atomic<bool> signal_;
};
} // namespace sta
#endif // STA_ATOMIC_SIGNAL_HPP