[core] Naive atomic type for ARMv5

std::atomic<bool> 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.
This commit is contained in:
Thiago Marcos P. Santos
2016-06-03 16:40:15 +03:00
parent 874fa41c12
commit 7b8698b47a
15 changed files with 76 additions and 30 deletions

View File

@@ -1,9 +1,9 @@
#include "run_loop_impl.hpp"
#include <mbgl/util/async_task.hpp>
#include <mbgl/util/atomic.hpp>
#include <mbgl/util/run_loop.hpp>
#include <atomic>
#include <functional>
namespace mbgl {
@@ -45,7 +45,7 @@ private:
// TODO: Use std::atomic_flag if we ever drop
// support for ARMv5
std::atomic<bool> queued;
util::Atomic<bool> queued;
std::function<void()> task;
};