Struct std::ThreadSched
struct ThreadSched {
struct TaskScheduler inner;
int priority[THREAD_MAX];
}Fields
underlying round-robin scheduler
per-thread priority (higher = first)
Methods
An empty thread scheduler (all slots empty, no threads running).
Spawn a thread running func(arg, resume_point) (same protocol as TaskScheduler::spawn). priority >= 0; higher values run earlier in each tick. Returns the Thread id (>= 0) or THREAD_NONE if the table is full.
Run one scheduling pass: threads are served in descending priority order. Returns the number of still-active threads.
Run until all threads complete.
Return 1 if thread t is still active (READY or RUNNING), 0 if DONE.
Cooperative join: calls tick() until thread t is done.
Return number of active (non-DONE) threads.