From c4987b12a10362e0b08f3182448a93d0e3c4a7d6 Mon Sep 17 00:00:00 2001 From: Hailey Somerville Date: Thu, 14 Sep 2023 13:53:36 +1000 Subject: [PATCH] add STATE_CLAIMED and renumber existing states for clarity --- embassy-executor/src/raw/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs index 6377adc3..0113510d 100644 --- a/embassy-executor/src/raw/mod.rs +++ b/embassy-executor/src/raw/mod.rs @@ -36,13 +36,15 @@ use super::SpawnToken; /// Task is eligible for allocation pub(crate) const STATE_ELIGIBLE: u32 = 0; +/// Task is claimed (ineligible for allocation, but does not have a valid future) +pub(crate) const STATE_CLAIMED: u32 = 1 << 0; /// Task is spawned (has a future) -pub(crate) const STATE_SPAWNED: u32 = 1 << 0; +pub(crate) const STATE_SPAWNED: u32 = 1 << 1; /// Task is in the executor run queue -pub(crate) const STATE_RUN_QUEUED: u32 = 1 << 1; +pub(crate) const STATE_RUN_QUEUED: u32 = 1 << 2; /// Task is in the executor timer queue #[cfg(feature = "integrated-timers")] -pub(crate) const STATE_TIMER_QUEUED: u32 = 1 << 2; +pub(crate) const STATE_TIMER_QUEUED: u32 = 1 << 3; /// Raw task header for use in task pointers. pub(crate) struct TaskHeader {