diff --git a/embassy/src/executor/raw/mod.rs b/embassy/src/executor/raw/mod.rs index 5cf399cd..fb6a5561 100644 --- a/embassy/src/executor/raw/mod.rs +++ b/embassy/src/executor/raw/mod.rs @@ -164,14 +164,14 @@ impl TaskStorage { /// Once the task has finished running, you may spawn it again. It is allowed to spawn it /// on a different executor. pub fn spawn(&'static self, future: impl FnOnce() -> F) -> SpawnToken { - if self.spawn_allocate() { + if self.spawn_mark_used() { unsafe { SpawnToken::::new(self.spawn_initialize(future)) } } else { SpawnToken::::new_failed() } } - fn spawn_allocate(&'static self) -> bool { + fn spawn_mark_used(&'static self) -> bool { let state = STATE_SPAWNED | STATE_RUN_QUEUED; self.raw .state @@ -234,7 +234,7 @@ impl TaskPool { /// which will cause [`Spawner::spawn()`] to return the error. pub fn spawn(&'static self, future: impl FnOnce() -> F) -> SpawnToken { for task in &self.pool { - if task.spawn_allocate() { + if task.spawn_mark_used() { return unsafe { SpawnToken::::new(task.spawn_initialize(future)) }; } } @@ -282,7 +282,7 @@ impl TaskPool { // by the user, with arbitrary hand-implemented futures. This is why these return `SpawnToken`. for task in &self.pool { - if task.spawn_allocate() { + if task.spawn_mark_used() { return SpawnToken::::new(task.spawn_initialize(future)); } }