summaryrefslogtreecommitdiff
path: root/src/mbgl/util/work_queue.hpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-07-14 17:01:20 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-07-17 20:58:38 +0300
commitdbf3edad8ae7a7cbaf7c109daa3f7f8c78c04c87 (patch)
treede301061c2218b13634ffc46c9f64a06aaf1e445 /src/mbgl/util/work_queue.hpp
parent38351554f45e02c1c7b59beeb11f5675d22f19b3 (diff)
downloadqtlocation-mapboxgl-dbf3edad8ae7a7cbaf7c109daa3f7f8c78c04c87.tar.gz
Add docs to WorkQueue and GlyphStore
Diffstat (limited to 'src/mbgl/util/work_queue.hpp')
-rw-r--r--src/mbgl/util/work_queue.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mbgl/util/work_queue.hpp b/src/mbgl/util/work_queue.hpp
index dcec5668b9..55b687a468 100644
--- a/src/mbgl/util/work_queue.hpp
+++ b/src/mbgl/util/work_queue.hpp
@@ -14,11 +14,18 @@ namespace util {
class RunLoop;
+// The WorkQueue will manage a queue of closures
+// and it will make sure they get executed on the
+// thread that created the WorkQueue. All pending
+// works are canceled when the queue gets destructed.
class WorkQueue : private util::noncopyable {
public:
WorkQueue();
- virtual ~WorkQueue();
+ ~WorkQueue();
+ // Push a closure to the queue. It is advised to
+ // only push tasks calling functions on the object
+ // that owns the queue to avoid use after free errors.
void push(std::function<void()>&&);
private: