make WorkRequests cancelable

This commit is contained in:
Konstantin Käfer
2015-05-08 14:49:32 +02:00
parent e20faf7a8d
commit 8ee40a544e
9 changed files with 112 additions and 74 deletions

View File

@@ -4,6 +4,7 @@
#include <mbgl/storage/file_source.hpp>
#include <mbgl/util/worker.hpp>
#include <mbgl/util/work_request.hpp>
#include <mbgl/platform/log.hpp>
using namespace mbgl;
@@ -56,9 +57,7 @@ void TileData::cancel() {
env.cancelRequest(req);
req = nullptr;
}
if (workRequest) {
workRequest.join();
}
workRequest.reset();
}
bool TileData::mayStartParsing() {