pub struct TaskInner { /* private fields */ }
Available on crate feature
multitask
only.Expand description
The inner task structure.
Implementations§
source§impl TaskInner
impl TaskInner
sourcepub fn new<F>(entry: F, name: String, stack_size: usize) -> Self
pub fn new<F>(entry: F, name: String, stack_size: usize) -> Self
Create a new task with the given entry function and stack size.
sourcepub fn join(&self) -> Option<i32>
pub fn join(&self) -> Option<i32>
Wait for the task to exit, and return the exit code.
It will return immediately if the task has already exited (but not dropped).
sourcepub unsafe fn task_ext_ptr(&self) -> *mut u8
pub unsafe fn task_ext_ptr(&self) -> *mut u8
Returns the pointer to the user-defined task extended data.
§Safety
The caller should not access the pointer directly, use TaskExtRef::task_ext
or TaskExtMut::task_ext_mut
instead.
source§impl TaskInner
impl TaskInner
sourcepub const fn ctx_mut(&mut self) -> &mut TaskContext
pub const fn ctx_mut(&mut self) -> &mut TaskContext
Returns a mutable reference to the task context.
sourcepub const fn kernel_stack_top(&self) -> Option<VirtAddr>
pub const fn kernel_stack_top(&self) -> Option<VirtAddr>
Returns the top address of the kernel stack.
Trait Implementations§
impl Send for TaskInner
impl Sync for TaskInner
Auto Trait Implementations§
impl !Freeze for TaskInner
impl !RefUnwindSafe for TaskInner
impl Unpin for TaskInner
impl !UnwindSafe for TaskInner
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more