Skip to main content

NativePrioritySetter

Trait NativePrioritySetter 

Source
pub trait NativePrioritySetter: Send + Sync {
    // Required method
    fn set_current_thread_priority(&self, native_priority: i32);
}
Available on crate feature std only.
Expand description

Hook for setting the native OS scheduler priority of a worker thread.

Called once per worker at thread start, with the lane’s native priority computed via the PriorityMapping. The concrete (platform-specific, often unsafe) implementation — e.g. pthread_setschedparam with SCHED_FIFO — is provided by the caller.

Required Methods§

Source

fn set_current_thread_priority(&self, native_priority: i32)

Sets the OS priority of the current thread.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§