diff options
Diffstat (limited to 'src/mbgl/util/atomic.hpp')
-rw-r--r-- | src/mbgl/util/atomic.hpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/mbgl/util/atomic.hpp b/src/mbgl/util/atomic.hpp deleted file mode 100644 index 3f68bf46a5..0000000000 --- a/src/mbgl/util/atomic.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include <atomic> -#include <mutex> - -namespace mbgl { -namespace util { - -// std::atomic<bool> is implemented lock free which -// is not supported by ARMv5 but the code generated -// seems to be using that and not working at all, -// thus, this naive implementation using mutexes. -#if defined(__ANDROID__) && defined(__ARM_ARCH_5TE__) - -template <typename T> -class Atomic { -public: - Atomic() = default; - explicit Atomic(const T& data_) : data(data_) {} - - void operator=(const T& other) { - std::lock_guard<std::mutex> lock(mtx); - data = other; - } - - operator bool() const { - std::lock_guard<std::mutex> lock(mtx); - - return data; - } - -private: - T data; - mutable std::mutex mtx; -}; - -#else - -template <typename T> -using Atomic = std::atomic<T>; - -#endif - -} // namespace util -} // namespace mbgl |