pub unsafe trait PinCurrentCpu {
// Provided method
fn current_cpu(&self) -> CpuId { ... }
}
Expand description
A marker trait for guard types that can “pin” the current task to the current CPU.
Such guard types include DisabledLocalIrqGuard
and
DisabledPreemptGuard
. When such guards exist, the CPU executing the
current task is pinned. So getting the current CPU ID or CPU-local
variables are safe.
§Safety
The implementor must ensure that the current task is pinned to the current CPU while any one of the instances of the implemented structure exists.
Provided Methods§
Sourcefn current_cpu(&self) -> CpuId
fn current_cpu(&self) -> CpuId
Returns the ID of the current CPU.