4#include <Settings/NamespaceSettings.hpp>
7#include <util/atomic.h>
11#ifdef ARDUINO_ARCH_MBED
12#include <CriticalSectionLock.h>
17#if defined(ATOMIC_INT_LOCK_FREE) && ATOMIC_INT_LOCK_FREE == 2
21 std::atomic<type>
value {};
35 constexpr static std::memory_order mo_rlx = std::memory_order_relaxed;
61 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
value += other; }
65 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { copy =
value; }
69 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
value = other; }
73 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
81#elif defined(ARDUINO_ARCH_MBED)
100 mbed::CriticalSectionLock lck;
104 mbed::CriticalSectionLock lck;
108 mbed::CriticalSectionLock lck;
112 mbed::CriticalSectionLock lck;
#define BEGIN_CS_NAMESPACE
AtomicPosition & operator=(const AtomicPosition &o)
AtomicPosition(AtomicPosition &&o)
AtomicPosition(const AtomicPosition &o)
AtomicPosition & operator=(AtomicPosition &&o)