Struct kernel::task::TaskRef[][src]

pub struct TaskRef<'a> { /* fields omitted */ }
Expand description

A wrapper for Task that doesn’t automatically decrement the refcount when dropped.

We need the wrapper because ManuallyDrop alone would allow callers to call ManuallyDrop::into_inner. This would allow an unsafe sequence to be triggered without unsafe blocks because it would trigger an unbalanced call to put_task_struct.

We make this explicitly not Send so that we can use it to represent the current thread without having to increment/decrement its reference count.

Invariants

The wrapped Task remains valid for the lifetime of the object.

Methods from Deref<Target = Task>

Returns the group leader of the given task.

Returns the PID of the given task.

Determines whether the given task has pending signals.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.