pub struct Executor { /* private fields */ }
Expand description
An executor backed by a work queue.
Examples
The following example runs two tasks on the shared system workqueue.
use kernel::kasync::executor::workqueue::Executor;
use kernel::spawn_task;
use kernel::workqueue;
let mut handle = Executor::try_new(workqueue::system())?;
spawn_task!(handle.executor(), async {
pr_info!("First workqueue task\n");
})?;
spawn_task!(handle.executor(), async {
pr_info!("Second workqueue task\n");
})?;
handle.detach();
Implementations
sourceimpl Executor
impl Executor
sourcepub fn try_new(wq: &'static Queue) -> Result<AutoStopHandle<Self>>
pub fn try_new(wq: &'static Queue) -> Result<AutoStopHandle<Self>>
Creates a new workqueue-based executor using a static work queue.
sourcepub fn try_new_owned(wq: BoxedQueue) -> Result<AutoStopHandle<Self>>
pub fn try_new_owned(wq: BoxedQueue) -> Result<AutoStopHandle<Self>>
Creates a new workqueue-based executor using an owned (boxed) work queue.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more