diff options
Diffstat (limited to 'embassy-executor/src/raw/run_queue.rs')
| -rw-r--r-- | embassy-executor/src/raw/run_queue.rs | 8 |
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 |
