From 7b8698b47a0ff5c4adaf474e47f89434f287f183 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 3 Jun 2016 16:40:15 +0300 Subject: [core] Naive atomic type for ARMv5 std::atomic is implemented lock free which doesn't work on ARMv5 and seems like the compiler is generating bogus code. This workaround is a naive implementation using regular mutexes. --- platform/android/src/async_task.cpp | 4 ++-- platform/android/src/run_loop_impl.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'platform') diff --git a/platform/android/src/async_task.cpp b/platform/android/src/async_task.cpp index 7b78eadb0c..6a9263baff 100644 --- a/platform/android/src/async_task.cpp +++ b/platform/android/src/async_task.cpp @@ -1,9 +1,9 @@ #include "run_loop_impl.hpp" #include +#include #include -#include #include namespace mbgl { @@ -45,7 +45,7 @@ private: // TODO: Use std::atomic_flag if we ever drop // support for ARMv5 - std::atomic queued; + util::Atomic queued; std::function task; }; diff --git a/platform/android/src/run_loop_impl.hpp b/platform/android/src/run_loop_impl.hpp index 5cf7231175..d855728b60 100644 --- a/platform/android/src/run_loop_impl.hpp +++ b/platform/android/src/run_loop_impl.hpp @@ -2,10 +2,10 @@ #include "jni.hpp" +#include #include #include -#include #include #include #include @@ -47,7 +47,7 @@ private: bool detach = false; ALooper* loop = nullptr; - std::atomic running; + util::Atomic running; std::recursive_mutex mtx; std::list runnables; -- cgit v1.2.1