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,9 +17,9 @@ namespace mbgl {
RasterDEMTile::RasterDEMTile(const OverscaledTileID& id_, const TileParameters& parameters, const Tileset& tileset)
: Tile(Kind::RasterDEM, id_),
loader(*this, id_, parameters, tileset),
threadPool(Scheduler::GetBackground()),
threadPool(parameters.threadPool),
mailbox(std::make_shared<Mailbox>(*Scheduler::GetCurrent())),
worker(Scheduler::GetBackground(), ActorRef<RasterDEMTile>(*this, mailbox)) {
worker(parameters.threadPool, ActorRef<RasterDEMTile>(*this, mailbox)) {
encoding = tileset.encoding;
if (id.canonical.y == 0) {
// this tile doesn't have upper neighboring tiles so marked those as backfilled
@@ -37,7 +37,7 @@ RasterDEMTile::~RasterDEMTile() {
// 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)}]() {});
}
}