Module thread_priority::unix
source · [−]Expand description
This module defines the unix thread control.
The crate’s prelude doesn’t have much control over the unix threads, and this module provides better control over those.
Structs
Proxy structure to maintain compatibility between glibc and musl
Enums
Normal (usual) schedule policies
The following “real-time” policies are also supported, for special time-critical applications that need precise control over the way in which runnable processes are selected for execution
Thread schedule policy definition
Traits
A helper trait for other threads to implement to be able to call methods on threads themselves.
Functions
Get current thread’s priority value.
Get the thread’s priority value.
Set current thread’s priority.
To make the priority of use, the scheduling policy is determined from the value.
If the value is not equal to ThreadPriority::Crossplatform(0)
, then the one of
the available real-time policies is used. Otherwise, the function does nothing,
as the only reasonable outcome with zero-priority set would be to change a scheduling
policy, for which there is set_thread_priority_and_policy
.
Sets thread’s priority and schedule policy
Returns current thread id, which is the current OS’s native handle. It may or may not be equal or even related to rust’s thread id, there is absolutely no guarantee for that.
Returns policy parameters (schedule policy and other schedule parameters) for current process
Returns policy parameters (schedule policy and other schedule parameters)
Type Definitions
An alias type for a thread id.