Struct axtask::CurrentTask
source · pub struct CurrentTask(/* private fields */);
Available on crate feature
multitask
only.Expand description
A wrapper of AxTaskRef
as the current task.
It won’t change the reference count of the task when created or dropped.
Implementations§
source§impl CurrentTask
impl CurrentTask
sourcepub fn as_task_ref(&self) -> &AxTaskRef
pub fn as_task_ref(&self) -> &AxTaskRef
Converts CurrentTask
to AxTaskRef
.
Methods from Deref<Target = TaskInner>§
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 kernel_stack_top(&self) -> Option<VirtAddr>
pub 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§
Auto Trait Implementations§
impl Freeze for CurrentTask
impl !RefUnwindSafe for CurrentTask
impl Send for CurrentTask
impl Sync for CurrentTask
impl Unpin for CurrentTask
impl !UnwindSafe for CurrentTask
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