From ccb15a640ec5c0fc1a2c7044bcb48f372595e789 Mon Sep 17 00:00:00 2001 From: Henrik Stickann <4376396-Mithradir@users.noreply.gitlab.com> Date: Tue, 12 Apr 2022 16:33:10 +0200 Subject: [PATCH] Add documentation --- include/sta/atomic/mutex.hpp | 10 +++++++++- include/sta/atomic/signal.hpp | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/sta/atomic/mutex.hpp b/include/sta/atomic/mutex.hpp index 33deb82..dcab789 100644 --- a/include/sta/atomic/mutex.hpp +++ b/include/sta/atomic/mutex.hpp @@ -1,3 +1,8 @@ +/** + * @brief Atomic mutex implementation. + * + * Define **STA_ATOMIC_ENABLE** to enable module. + */ #ifndef STA_ATOMIC_MUTEX_HPP #define STA_ATOMIC_MUTEX_HPP @@ -11,6 +16,9 @@ namespace sta { + /** + * @brief Implementation of `Mutex` interface using `std::atomic_flag`. + */ class AtomicMutex : public Mutex { public: @@ -20,7 +28,7 @@ namespace sta void release() override; private: - std::atomic_flag lock_; + std::atomic_flag lock_; /**< Atomic flag used as lock */ }; } // namespace sta diff --git a/include/sta/atomic/signal.hpp b/include/sta/atomic/signal.hpp index 4baa76b..4ca8cfc 100644 --- a/include/sta/atomic/signal.hpp +++ b/include/sta/atomic/signal.hpp @@ -1,3 +1,8 @@ +/** + * @brief Atomic signal implementation. + * + * Define **STA_ATOMIC_ENABLE** to enable module. + */ #ifndef STA_ATOMIC_SIGNAL_HPP #define STA_ATOMIC_SIGNAL_HPP @@ -11,6 +16,9 @@ namespace sta { + /** + * @brief Implementation of `Signal` interface using `std::atomic`. + */ class AtomicSignal : public Signal { public: @@ -22,7 +30,7 @@ namespace sta void wait() override; private: - std::atomic signal_; + std::atomic signal_; /**< Atomic bool used as signal */ }; } // namespace sta