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.
Sourcepub fn init_task_ext<T: Sized>(&mut self, data: T) -> Option<&T>
pub fn init_task_ext<T: Sized>(&mut self, data: T) -> Option<&T>
Initialize the user-defined task extended data.
Returns a reference to the task extended data if it has not been
initialized yet (empty), otherwise returns None
.
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.
Sourcepub fn cpumask(&self) -> AxCpuMask
pub fn cpumask(&self) -> AxCpuMask
Gets the cpu affinity mask of the task.
Returns the cpu affinity mask of the task in type AxCpuMask
.
Sourcepub fn set_cpumask(&self, cpumask: AxCpuMask)
pub fn set_cpumask(&self, cpumask: AxCpuMask)
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