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§
- Deadline
Flags - Flags for controlling Deadline scheduling behavior.
- Sched
Attr - A copy of the Linux kernel’s sched_attr type.
- Schedule
Params - Proxy structure to maintain compatibility between glibc and musl
Enums§
- Normal
Thread Schedule Policy - Normal (non-realtime) schedule policies
For these schedule policies,
niceness
is used. - Priority
Policy Edge Value Type - Defines the type of the priority edge value: minimum or maximum.
- Realtime
Thread Schedule Policy - 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 - Thread schedule policy definition.
Constants§
- NICENESS_
MAX - The maximum value possible for niceness. Threads with this value of niceness have the highest priority possible
- NICENESS_
MIN - The minimum value possible for niceness. Threads with this value of niceness have the lowest priority possible.
Traits§
- Thread
Ext - A helper trait for other threads to implement to be able to call methods on threads themselves.
Functions§
- get_
current_ thread_ priority - Get current thread’s priority value.
- get_
thread_ priority - Get the thread’s priority value.
- get_
thread_ scheduling_ attributes - Returns scheduling attributes for the current thread.
- set_
current_ thread_ priority - Set current thread’s priority. In order to properly map a value of the thread priority, the thread scheduling must be known. This function attempts to retrieve the current thread’s scheduling policy and thus map the priority value correctly, so that it fits within the scheduling policy’s allowed range of values.
- set_
thread_ priority_ and_ policy - Sets thread’s priority and schedule policy
- thread_
native_ id - 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.
- thread_
schedule_ policy - Returns policy parameters (schedule policy and other schedule parameters) for current process
- thread_
schedule_ policy_ param - Returns policy parameters (schedule policy and other schedule parameters)
Type Aliases§
- Thread
Id - An alias type for a thread id.