Skip to main content

ax_task/thread/
state_kind.rs

1//! Public scheduler lifecycle observations.
2
3/// Observable lifecycle state of a thread.
4#[repr(u8)]
5#[derive(Clone, Copy, Debug, Eq, PartialEq)]
6pub enum ThreadState {
7    /// Allocated but not admitted to a run queue.
8    New     = 0,
9    /// Linux-style `TASK_RUNNING`, whether queued or executing on a CPU.
10    Running = 2,
11    /// Publishing a block operation while racing with wake-up.
12    Parking = 3,
13    /// Asleep on a wait object.
14    Blocked = 4,
15    /// A wake operation won the block/wake race.
16    Waking  = 5,
17    /// Execution has terminated and resources await reaping.
18    Exited  = 6,
19}