From d32477f5a19496911a2a95b002bb7cddf5b9e605 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sat, 16 Oct 2021 01:49:30 +0200 Subject: [PATCH] executor: Inline enqueue fns --- embassy/src/executor/raw/mod.rs | 1 + embassy/src/executor/raw/run_queue.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/embassy/src/executor/raw/mod.rs b/embassy/src/executor/raw/mod.rs index bc20db332..5ee38715d 100644 --- a/embassy/src/executor/raw/mod.rs +++ b/embassy/src/executor/raw/mod.rs @@ -257,6 +257,7 @@ impl Executor { /// - `task` must be a valid pointer to a spawned task. /// - `task` must be set up to run in this executor. /// - `task` must NOT be already enqueued (in this executor or another one). + #[inline(always)] unsafe fn enqueue(&self, cs: CriticalSection, task: *mut TaskHeader) { if self.run_queue.enqueue(cs, task) { (self.signal_fn)(self.signal_ctx) diff --git a/embassy/src/executor/raw/run_queue.rs b/embassy/src/executor/raw/run_queue.rs index 3d68d659b..7aa2079fa 100644 --- a/embassy/src/executor/raw/run_queue.rs +++ b/embassy/src/executor/raw/run_queue.rs @@ -44,6 +44,7 @@ impl RunQueue { /// # Safety /// /// `item` must NOT be already enqueued in any queue. + #[inline(always)] pub(crate) unsafe fn enqueue(&self, _cs: CriticalSection, task: *mut TaskHeader) -> bool { let prev = self.head.load(Ordering::Relaxed); (*task).run_queue_item.next.store(prev, Ordering::Relaxed);