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:
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user