Add TaggedScheduler, couple lifetime of tasks and orchestrator (#2398)
This commit is contained in:
@@ -67,11 +67,12 @@ public:
|
||||
// From Scheduler. Schedules by using callbacks to the
|
||||
// JVM to process the mailbox on the right thread.
|
||||
void schedule(std::function<void()>&& scheduled) override;
|
||||
void schedule(const util::SimpleIdentity, std::function<void()>&& fn) override { schedule(std::move(fn)); };
|
||||
|
||||
mapbox::base::WeakPtr<Scheduler> makeWeakPtr() override { return weakFactory.makeWeakPtr(); }
|
||||
|
||||
// Wait for the queue to be empty
|
||||
// A timeout of zero results in an unbounded wait
|
||||
std::size_t waitForEmpty(Milliseconds timeout) override;
|
||||
void waitForEmpty(const util::SimpleIdentity tag) override;
|
||||
|
||||
void requestRender();
|
||||
|
||||
@@ -79,6 +80,9 @@ public:
|
||||
using SnapshotCallback = std::function<void(PremultipliedImage)>;
|
||||
void requestSnapshot(SnapshotCallback);
|
||||
|
||||
AndroidRendererBackend& getRendererBackend() const { return *backend; }
|
||||
const TaggedScheduler& getThreadPool() const { return threadPool; }
|
||||
|
||||
protected:
|
||||
// Called from the GL Thread //
|
||||
|
||||
@@ -119,7 +123,7 @@ private:
|
||||
float pixelRatio;
|
||||
std::optional<std::string> localIdeographFontFamily;
|
||||
|
||||
std::shared_ptr<ThreadPool> threadPool;
|
||||
TaggedScheduler threadPool;
|
||||
const MailboxData mailboxData;
|
||||
|
||||
std::mutex initialisationMutex;
|
||||
|
||||
Reference in New Issue
Block a user