From 4e3503ea6cf30c55a2cc86f78c4a607bd14f1c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 16 Oct 2015 13:53:43 +0200 Subject: [core] do not use std::atomic_* with shared_ptrs It's not implemented in GCC 4.9.2's stdlib (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57250). Instead, we're now always using a mutex to protect access; we previously created a mutex only on cancelation, but since we're always canceling now, it makes sense to allocate it right away. --- include/mbgl/storage/request.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/mbgl/storage/request.hpp b/include/mbgl/storage/request.hpp index 4b75f23f6e..1fb15c5a92 100644 --- a/include/mbgl/storage/request.hpp +++ b/include/mbgl/storage/request.hpp @@ -33,13 +33,13 @@ public: private: ~Request(); - void invoke(); void notifyCallback(); private: - std::unique_ptr async; - struct Canceled; - std::unique_ptr canceled; + std::mutex mtx; + bool canceled = false; + bool confirmed = false; + const std::unique_ptr async; Callback callback; std::shared_ptr response; -- cgit v1.2.1