mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 22:54:52 +00:00
Remove special handling of integrated timer items
This commit is contained in:
parent
c9f32b7e36
commit
fbd0fe06bd
@ -96,29 +96,6 @@ impl TaskRef {
|
|||||||
&self.header().timer_queue_item
|
&self.header().timer_queue_item
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Mark the task as timer-queued. Return whether it should be actually enqueued
|
|
||||||
/// using `_embassy_time_schedule_wake`.
|
|
||||||
///
|
|
||||||
/// Entering this state prevents the task from being respawned while in a timer queue.
|
|
||||||
///
|
|
||||||
/// Safety:
|
|
||||||
///
|
|
||||||
/// This functions should only be called by the timer queue driver, before
|
|
||||||
/// enqueueing the timer item.
|
|
||||||
pub unsafe fn timer_enqueue(&self) -> timer_queue::TimerEnqueueOperation {
|
|
||||||
self.header().state.timer_enqueue()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Unmark the task as timer-queued.
|
|
||||||
///
|
|
||||||
/// Safety:
|
|
||||||
///
|
|
||||||
/// This functions should only be called by the timer queue implementation, after the task has
|
|
||||||
/// been removed from the timer queue.
|
|
||||||
pub unsafe fn timer_dequeue(&self) {
|
|
||||||
self.header().state.timer_dequeue()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The returned pointer is valid for the entire TaskStorage.
|
/// The returned pointer is valid for the entire TaskStorage.
|
||||||
pub(crate) fn as_ptr(self) -> *const TaskHeader {
|
pub(crate) fn as_ptr(self) -> *const TaskHeader {
|
||||||
self.ptr.as_ptr()
|
self.ptr.as_ptr()
|
||||||
|
@ -71,14 +71,3 @@ impl TimerQueueItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The operation to perform after `timer_enqueue` is called.
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
|
||||||
#[must_use]
|
|
||||||
pub enum TimerEnqueueOperation {
|
|
||||||
/// Enqueue the task (or update its expiration time).
|
|
||||||
Enqueue,
|
|
||||||
/// The task must not be enqueued in the timer queue.
|
|
||||||
Ignore,
|
|
||||||
}
|
|
||||||
|
@ -83,7 +83,6 @@ impl Queue {
|
|||||||
// Remove it
|
// Remove it
|
||||||
prev.set(item.next.get());
|
prev.set(item.next.get());
|
||||||
item.next.set(None);
|
item.next.set(None);
|
||||||
unsafe { p.timer_dequeue() };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user