summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/actor/scheduler.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/mbgl/actor/scheduler.hpp b/include/mbgl/actor/scheduler.hpp
index 7338c3ab3a..bb2cf124b8 100644
--- a/include/mbgl/actor/scheduler.hpp
+++ b/include/mbgl/actor/scheduler.hpp
@@ -40,6 +40,16 @@ public:
// Makes a weak pointer to this Scheduler.
virtual mapbox::base::WeakPtr<Scheduler> makeWeakPtr() = 0;
+ // Returns a closure wrapping the given one.
+ //
+ // When the returned closure is invoked for the first time, it schedules
+ // the given closure to this scheduler, the consequent calls of the
+ // returned closure are ignored.
+ //
+ // If this scheduler is already deleted by the time the returnded closure is
+ // first invoked, the call is ignored.
+ std::function<void()> bindOnce(std::function<void()>);
+
// Set/Get the current Scheduler for this thread
static Scheduler* GetCurrent();
static void SetCurrent(Scheduler*);