aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor
diff options
context:
space:
mode:
authorDániel Buga <[email protected]>2024-12-16 18:08:19 +0100
committerDániel Buga <[email protected]>2024-12-16 19:22:22 +0100
commit3c121e5425e0a1901c459d27e3e5929f86d0a206 (patch)
tree39c8c1ff1a5aeaa0c62100880b5d9966866a630f /embassy-executor
parentd3f0294fb12e060c4a3ba557ff95766d1c3686e0 (diff)
Remove special handling of integrated timer queue
Diffstat (limited to 'embassy-executor')
-rw-r--r--embassy-executor/src/raw/mod.rs22
1 files changed, 0 insertions, 22 deletions
diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs
index 5a476213b..997db6756 100644
--- a/embassy-executor/src/raw/mod.rs
+++ b/embassy-executor/src/raw/mod.rs
@@ -195,25 +195,7 @@ impl<F: Future + 'static> TaskStorage<F> {
195 match future.poll(&mut cx) { 195 match future.poll(&mut cx) {
196 Poll::Ready(_) => { 196 Poll::Ready(_) => {
197 this.future.drop_in_place(); 197 this.future.drop_in_place();
198
199 // Mark this task to be timer queued.
200 // We're splitting the enqueue in two parts, so that we can change task state
201 // to something that prevent re-queueing.
202 let op = this.raw.state.timer_enqueue();
203
204 // Now mark the task as not spawned, so that
205 // - it can be spawned again once it has been removed from the timer queue
206 // - it can not be timer-queued again
207 // We must do this before scheduling the wake, to prevent the task from being
208 // dequeued by the time driver while it's still SPAWNED.
209 this.raw.state.despawn(); 198 this.raw.state.despawn();
210
211 // Now let's finish enqueueing. While we shouldn't get an `Ignore` here, it's
212 // better to be safe.
213 if op == timer_queue::TimerEnqueueOperation::Enqueue {
214 // Schedule the task in the past, so it gets dequeued ASAP.
215 unsafe { _embassy_time_schedule_wake(0, &waker) }
216 }
217 } 199 }
218 Poll::Pending => {} 200 Poll::Pending => {}
219 } 201 }
@@ -232,10 +214,6 @@ impl<F: Future + 'static> TaskStorage<F> {
232 } 214 }
233} 215}
234 216
235extern "Rust" {
236 fn _embassy_time_schedule_wake(at: u64, waker: &core::task::Waker);
237}
238
239/// An uninitialized [`TaskStorage`]. 217/// An uninitialized [`TaskStorage`].
240pub struct AvailableTask<F: Future + 'static> { 218pub struct AvailableTask<F: Future + 'static> {
241 task: &'static TaskStorage<F>, 219 task: &'static TaskStorage<F>,