class · System.Threading.Tasks
Scheduler
public class System.Threading.Tasks.Scheduler : System.Any
Runs tasks on this thread, one at a time: those ready (in order), then the timers that are due; when nothing is ready it sleeps until the next timer.
- Tipo
- class
- Espacio de nombres
- System.Threading.Tasks
- Ensamblado
- System.Core
- Acceso
- public, static, abstract
- Archivo fuente
Tasks.ant
Herencia
- Clases base
-
AnyScheduler
Propiedades
static property Sync: System.Threading.Mutex
#
static property Changed: System.Threading.Condition
#
Whether a thread sleeps on Changed (read holding Sync).
Métodos
Whether the caller is the scheduler's thread (the program's first).
static method Ready(task: System.Threading.Tasks.Task) -> void
#
Runs task in its turn (Run()). On another thread (holding Sync): it goes to the scheduler's inbox.
static method Started() -> void
#
A Task.Run body starts, and has finished.
static method Finished() -> void
#
static method BlockUntil(task: System.Threading.Tasks.Task) -> void
#
Waits (another thread than the scheduler's) until task has finished.
static method Soon(task: System.Threading.Tasks.Task) -> void
#
Done in its turn (after what is ready now).
static method After(task: System.Threading.Tasks.Task, milliseconds: i32) -> void
#
Done after milliseconds.
static method RunUntil(task: System.Threading.Tasks.Task) -> void
#
Runs ready tasks and timers until task has finished (or nothing is left that could finish it).
The timer that is due first.
Completes the timers whose time has come (the first due first): whether there was one.
static method Timers() -> void
#
Completes the timers that are due; when none is, sleeps until the first one. Once threads complete tasks, the sleep is on Changed (a task completed on another thread wakes it): the timer only bounds it.
Miembros privados e internos (12)
static field ready: System.List<System.Threading.Tasks.Task>
#
static field timers: System.List<System.Threading.Tasks.Task>
#
static field due: System.List<i64>
#
Once Task.Run was used: tasks made ready on other threads (under Sync), and how many Task.Run bodies are running.
static field sync: System.Threading.Mutex
#
static field changed: System.Threading.Condition
#
static field inbox: System.List<System.Threading.Tasks.Task>
#
Threads asleep on Changed (under Sync): a change wakes them only if there are some.
static method Sleep() -> void
#
Sleeps on Changed (holding Sync).
static method Drain() -> void
#
Moves what other threads made ready to the ready list.
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
Scheduler en Larva HIR, descompilado a partir de su Larva HIR.
// Runs tasks on this thread, one at a time: those ready (in order), then the timers that are due; when nothing is
// ready it sleeps until the next timer.
public class System.Threading.Tasks.Scheduler : System.Any
{
static field ready: System.List<System.Threading.Tasks.Task>
static field first: i32
static field timers: System.List<System.Threading.Tasks.Task>
static field due: System.List<i64>
// Once Task.Run was used: tasks made ready on other threads (under Sync), and how many Task.Run bodies are running.
static field threaded: bool
static field sync: System.Threading.Mutex
static field changed: System.Threading.Condition
static field inbox: System.List<System.Threading.Tasks.Task>
static field running: i32
// Threads asleep on Changed (under Sync): a change wakes them only if there are some.
static field sleepers: i32
// Sleeps on Changed (holding Sync).
static method Sleep() -> void
// Moves what other threads made ready to the ready list.
static method Drain() -> void
// Whether the caller is the scheduler's thread (the program's first).
static method OnItsThread() -> bool
// Runs `task` in its turn (`Run()`). On another thread (holding Sync): it goes to the scheduler's inbox.
static method Ready(task: System.Threading.Tasks.Task) -> void
// A Task.Run body starts, and has finished.
static method Started() -> void
static method Finished() -> void
// Waits (another thread than the scheduler's) until `task` has finished.
static method BlockUntil(task: System.Threading.Tasks.Task) -> void
// Done in its turn (after what is ready now).
static method Soon(task: System.Threading.Tasks.Task) -> void
// Done after `milliseconds`.
static method After(task: System.Threading.Tasks.Task, milliseconds: i32) -> void
// Runs ready tasks and timers until `task` has finished (or nothing is left that could finish it).
static method RunUntil(task: System.Threading.Tasks.Task) -> void
// The timer that is due first.
static method Soonest() -> i32
// Completes the timers whose time has come (the first due first): whether there was one.
static method Due(now: i64) -> bool
// Completes the timers that are due; when none is, sleeps until the first one. Once threads complete tasks, the
// sleep is on Changed (a task completed on another thread wakes it): the timer only bounds it.
static method Timers() -> void
static property Threaded: bool
static property Sync: System.Threading.Mutex
static property Changed: System.Threading.Condition
// Whether a thread sleeps on Changed (read holding Sync).
static property Sleeping: bool
}