Add TaggedScheduler, couple lifetime of tasks and orchestrator (#2398)
This commit is contained in:
@@ -216,8 +216,7 @@ Milliseconds RunLoop::Impl::processRunnables() {
|
||||
return timeout;
|
||||
}
|
||||
|
||||
std::size_t RunLoop::Impl::waitForEmpty(Milliseconds timeout) {
|
||||
const auto startTime = mbgl::util::MonotonicTimer::now();
|
||||
void RunLoop::Impl::waitForEmpty() {
|
||||
while (true) {
|
||||
std::size_t remaining;
|
||||
{
|
||||
@@ -225,10 +224,8 @@ std::size_t RunLoop::Impl::waitForEmpty(Milliseconds timeout) {
|
||||
remaining = runnables.size();
|
||||
}
|
||||
|
||||
const auto elapsed = mbgl::util::MonotonicTimer::now() - startTime;
|
||||
const auto elapsedMillis = std::chrono::duration_cast<Milliseconds>(elapsed);
|
||||
if (remaining == 0 || (Milliseconds::zero() < timeout && timeout <= elapsedMillis)) {
|
||||
return remaining;
|
||||
if (remaining == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
runLoop->runOnce();
|
||||
@@ -257,8 +254,8 @@ void RunLoop::wake() {
|
||||
impl->wake();
|
||||
}
|
||||
|
||||
std::size_t RunLoop::waitForEmpty(std::chrono::milliseconds timeout) {
|
||||
return impl->waitForEmpty(timeout);
|
||||
void RunLoop::waitForEmpty([[maybe_unused]] const SimpleIdentity tag) {
|
||||
impl->waitForEmpty();
|
||||
}
|
||||
|
||||
void RunLoop::run() {
|
||||
|
||||
Reference in New Issue
Block a user