aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src/raw/run_queue.rs
diff options
context:
space:
mode:
authorDion Dokter <[email protected]>2025-07-15 13:40:30 +0200
committerDario Nieuwenhuis <[email protected]>2025-09-11 14:45:06 +0200
commit3f606b28f3b32e9e3b9a9f136eeef52828a78512 (patch)
tree640fec12732e7104516c9edbd79261d214887f96 /embassy-executor/src/raw/run_queue.rs
parentb5c9e721009fd4331cdc1ce58a07698eb54f2959 (diff)
Change deadline to use internal atomics
Diffstat (limited to 'embassy-executor/src/raw/run_queue.rs')
-rw-r--r--embassy-executor/src/raw/run_queue.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/embassy-executor/src/raw/run_queue.rs b/embassy-executor/src/raw/run_queue.rs
index 97060f4b9..e8a046a48 100644
--- a/embassy-executor/src/raw/run_queue.rs
+++ b/embassy-executor/src/raw/run_queue.rs
@@ -108,11 +108,9 @@ impl RunQueue {
108 /// runqueue are both empty, at which point this function will return. 108 /// runqueue are both empty, at which point this function will return.
109 #[cfg(feature = "edf-scheduler")] 109 #[cfg(feature = "edf-scheduler")]
110 pub(crate) fn dequeue_all(&self, on_task: impl Fn(TaskRef)) { 110 pub(crate) fn dequeue_all(&self, on_task: impl Fn(TaskRef)) {
111 // SAFETY: `deadline` can only be set through the `Deadline` interface, which 111 let mut sorted = SortedList::<TaskHeader>::new_with_cmp(|lhs, rhs| {
112 // only allows access to this value while the given task is being polled. 112 lhs.deadline.instant_ticks().cmp(&rhs.deadline.instant_ticks())
113 // This acts as mutual exclusion for access. 113 });
114 let mut sorted =
115 SortedList::<TaskHeader>::new_with_cmp(|lhs, rhs| unsafe { lhs.deadline.get().cmp(&rhs.deadline.get()) });
116 114
117 loop { 115 loop {
118 // For each loop, grab any newly pended items 116 // For each loop, grab any newly pended items