Skip to main content

PlatformScheduler

Trait PlatformScheduler 

Source
pub trait PlatformScheduler {
    // Provided methods
    fn set_current_thread_policy(_p: SchedPolicy) -> Result<(), SchedError> { ... }
    fn yield_now() { ... }
    fn set_affinity(_cpu_mask: u32) -> Result<(), SchedError> { ... }
}

Provided Methods§

Source

fn set_current_thread_policy(_p: SchedPolicy) -> Result<(), SchedError>

Apply the requested policy to the calling thread.

Default returns SchedError::Unsupported so single-core bare- metal targets and RTOS impls without per-thread scheduling pickup the no-op behavior automatically. Platforms with a real scheduler override this.

Source

fn yield_now()

Cooperative yield. Same semantics as PlatformYield::yield_now; mirrored here so consumers don’t need to import both traits when only the scheduler control surface is in scope. Default is a core::hint::spin_loop().

Source

fn set_affinity(_cpu_mask: u32) -> Result<(), SchedError>

Pin the calling thread to the CPUs whose bit is set in cpu_mask. Default returns SchedError::Unsupported — platforms with affinity APIs override.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§