Add TaggedScheduler, couple lifetime of tasks and orchestrator (#2398)
This commit is contained in:
@@ -91,8 +91,7 @@ void RunLoop::runOnce() {
|
||||
}
|
||||
}
|
||||
|
||||
std::size_t RunLoop::waitForEmpty(std::chrono::milliseconds timeout) {
|
||||
const auto startTime = mbgl::util::MonotonicTimer::now();
|
||||
void RunLoop::waitForEmpty([[maybe_unused]] const mbgl::util::SimpleIdentity tag) {
|
||||
while (true) {
|
||||
std::size_t remaining;
|
||||
{
|
||||
@@ -100,10 +99,8 @@ std::size_t RunLoop::waitForEmpty(std::chrono::milliseconds timeout) {
|
||||
remaining = defaultQueue.size() + highPriorityQueue.size();
|
||||
}
|
||||
|
||||
const auto elapsed = mbgl::util::MonotonicTimer::now() - startTime;
|
||||
const auto elapsedMillis = std::chrono::duration_cast<std::chrono::milliseconds>(elapsed);
|
||||
if (remaining == 0 || timeout <= elapsedMillis) {
|
||||
return remaining;
|
||||
if (remaining == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
runOnce();
|
||||
|
||||
Reference in New Issue
Block a user