pub struct WakeList<K: Kernel> {
threads: ForeignList<Thread<K>, ThreadListAdapter<K>>,
}Expand description
A list of threads dequeued from a wait queue that are not yet runnable.
Dequeuing into a WakeList allows a caller to release all references to a
wait queue (or an object embedding it, like a stack-allocated event) before
the woken threads are made runnable and can destroy that storage.
Use WakeList::wake_and_reschedule to make the threads runnable.
Fields§
§threads: ForeignList<Thread<K>, ThreadListAdapter<K>>Implementations§
Source§impl<K: Kernel> WakeList<K>
impl<K: Kernel> WakeList<K>
pub const fn new() -> Self
pub fn is_empty(&self) -> bool
pub(super) fn push(&mut self, thread: ForeignBox<Thread<K>>)
Sourcepub fn wake_and_reschedule<'a>(
self,
kernel: K,
sched: SpinLockGuard<'a, K, SchedulerState<K>>,
) -> SpinLockGuard<'a, K, SchedulerState<K>>
pub fn wake_and_reschedule<'a>( self, kernel: K, sched: SpinLockGuard<'a, K, SchedulerState<K>>, ) -> SpinLockGuard<'a, K, SchedulerState<K>>
Makes all threads in the list runnable and reschedules if any were woken.