Make Bucket::uploaded an atomic bool

This class is called from multiple threads, so we better make this
synchronization flag atomic.
This commit is contained in:
Bruno de Oliveira Abinader
2015-08-25 11:18:27 -07:00
parent 15a5532d76
commit c7dfbec96e

View File

@@ -5,6 +5,8 @@
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/mat4.hpp>
#include <atomic>
#define BUFFER_OFFSET(i) ((char*)nullptr + (i))
namespace mbgl {
@@ -15,6 +17,8 @@ class TileID;
class Bucket : private util::noncopyable {
public:
Bucket() : uploaded(false) {}
// As long as this bucket has a Prepare render pass, this function is getting called. Typically,
// this only happens once when the bucket is being rendered for the first time.
virtual void upload() = 0;
@@ -33,7 +37,7 @@ public:
virtual void swapRenderData() {}
protected:
bool uploaded = false;
std::atomic<bool> uploaded;
};