pub struct LocalTask<System: KernelBase>(_, _);
Expand description
A non-Send
, 'static
task reference. The lack of Send
-ness constrains
its lifetime to the owning task and thus allows it to represent a current
task safely.
See TaskRef
for the Send
counterpart.
See TaskMethods
for the operations provided by this handle
type.
Implementations§
source§impl<System: KernelBase> LocalTask<System>
impl<System: KernelBase> LocalTask<System>
sourcepub fn current() -> Result<Self, GetCurrentTaskError>
pub fn current() -> Result<Self, GetCurrentTaskError>
Get the current task (i.e., the task that is assigned to the current processor and in the Running state).
Returns GetCurrentTaskError::BadContext
if called from a non-task
context.
Rationale: Getting a current task in a non-task context does make sense, but the result may be soon invalidated (potentially violating the [object safety] of
LocalTask
) and made unreliable by various factors.
Trait Implementations§
source§impl<System: KernelBase> Clone for LocalTask<System>
impl<System: KernelBase> Clone for LocalTask<System>
source§impl<System: KernelBase> Debug for LocalTask<System>
impl<System: KernelBase> Debug for LocalTask<System>
source§impl<System: KernelBase> Hash for LocalTask<System>
impl<System: KernelBase> Hash for LocalTask<System>
source§impl<System: KernelBase, T: TaskHandle<System = System>> PartialEq<T> for LocalTask<System>
impl<System: KernelBase, T: TaskHandle<System = System>> PartialEq<T> for LocalTask<System>
source§impl<System: KernelBase> TaskHandle for LocalTask<System>
impl<System: KernelBase> TaskHandle for LocalTask<System>
impl<System: KernelBase> Copy for LocalTask<System>
impl<System: KernelBase> Eq for LocalTask<System>
impl<System: KernelBase> Sync for LocalTask<System>
Auto Trait Implementations§
impl<System> RefUnwindSafe for LocalTask<System>where <System as KernelBase>::RawTaskId: RefUnwindSafe,
impl<System> !Send for LocalTask<System>
impl<System> Unpin for LocalTask<System>where <System as KernelBase>::RawTaskId: Unpin,
impl<System> UnwindSafe for LocalTask<System>where <System as KernelBase>::RawTaskId: UnwindSafe,
Blanket Implementations§
source§impl<T> TaskMethods for Twhere
T: TaskHandle,
impl<T> TaskMethods for Twhere T: TaskHandle,
source§fn interrupt(&self) -> Result<(), InterruptTaskError>
fn interrupt(&self) -> Result<(), InterruptTaskError>
Interrupt any ongoing wait operations undertaken by the task. Read more
source§fn unpark(&self) -> Result<(), UnparkError>
fn unpark(&self) -> Result<(), UnparkError>
Make the task’s token available, unblocking
Kernel::park
now or in
the future. Read moresource§fn unpark_exact(&self) -> Result<(), UnparkExactError>
fn unpark_exact(&self) -> Result<(), UnparkExactError>
Make exactly one new token available for the task, unblocking
Kernel::park
now or in the future. Read moresource§fn set_priority(&self, priority: usize) -> Result<(), SetTaskPriorityError>where
Self::System: KernelTaskSetPriority,
fn set_priority(&self, priority: usize) -> Result<(), SetTaskPriorityError>where Self::System: KernelTaskSetPriority,
Set the task’s base priority. Read more
source§fn priority(&self) -> Result<usize, GetTaskPriorityError>
fn priority(&self) -> Result<usize, GetTaskPriorityError>
Get the task’s base priority. Read more
source§fn effective_priority(&self) -> Result<usize, GetTaskPriorityError>
fn effective_priority(&self) -> Result<usize, GetTaskPriorityError>
Get the task’s effective priority. Read more