std :: sync::task
Trait std::TaskRunner
trait TaskRunner {
int tick();
void run_all();
int active_count() const;
}What a cooperative scheduler offers to the code driving it: one round, run to completion, and how many tasks are left. TaskScheduler and ThreadSched (thread_bare.h, priority-ordered) both conform, so a driver loop written once against TaskRunner runs either. Spawning isn't part of it: ThreadSched::spawn takes a priority that TaskScheduler::spawn has no place for. (Not called Scheduler: that's kernel/scheduler.h's struct.)
Required methods
one round; returns the still-active count
until every task is done