summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-03-13 15:30:10 +0100
committerKonstantin Käfer <mail@kkaefer.com>2015-03-13 15:30:10 +0100
commit069505fe7567bc9656d7922a56c9118431e45a37 (patch)
treed7988b89f639625a47d71e4e8d72b3432ea0919d /include
parent5e40f72b7cd5fd937ba8b628678cd5122298e8e5 (diff)
downloadqtlocation-mapboxgl-069505fe7567bc9656d7922a56c9118431e45a37.tar.gz
fix rare issue that had the notify and cancel callbacks called in the wrong order
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/storage/default/request.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/mbgl/storage/default/request.hpp b/include/mbgl/storage/default/request.hpp
index b686d1fe90..00157329be 100644
--- a/include/mbgl/storage/default/request.hpp
+++ b/include/mbgl/storage/default/request.hpp
@@ -6,6 +6,8 @@
#include <mbgl/util/util.hpp>
#include <mbgl/util/noncopyable.hpp>
+#include <mutex>
+#include <thread>
#include <functional>
#include <memory>
@@ -35,12 +37,12 @@ public:
private:
~Request();
void invoke();
- static void notifyCallback(uv_async_t *async);
- static void cancelCallback(uv_async_t *async);
+ void notifyCallback();
private:
- uv_async_t *notifyAsync = nullptr;
- uv_async_t *destructAsync = nullptr;
+ uv_async_t *async = nullptr;
+ struct Canceled;
+ std::unique_ptr<Canceled> canceled;
Callback callback;
std::shared_ptr<const Response> response;