Add TaggedScheduler, couple lifetime of tasks and orchestrator (#2398)

This commit is contained in:
mwilsnd
2024-06-28 17:20:03 -04:00
committed by GitHub
parent b2fe5021b8
commit c4c75452b6
99 changed files with 759 additions and 489 deletions

View File

@@ -17,16 +17,16 @@ namespace mbgl {
RasterTile::RasterTile(const OverscaledTileID& id_, const TileParameters& parameters, const Tileset& tileset)
: Tile(Kind::Raster, id_),
loader(*this, id_, parameters, tileset),
threadPool(Scheduler::GetBackground()),
threadPool(parameters.threadPool),
mailbox(std::make_shared<Mailbox>(*Scheduler::GetCurrent())),
worker(Scheduler::GetBackground(), ActorRef<RasterTile>(*this, mailbox)) {}
worker(parameters.threadPool, ActorRef<RasterTile>(*this, mailbox)) {}
RasterTile::~RasterTile() {
markObsolete();
// The bucket has resources that need to be released on the render thread.
if (bucket) {
threadPool->runOnRenderThread([bucket_{std::move(bucket)}]() {});
threadPool.runOnRenderThread([bucket_{std::move(bucket)}]() {});
}
}