Function thread_priority::windows::set_winapi_thread_priority
source · pub fn set_winapi_thread_priority(
native: ThreadId,
priority: WinAPIThreadPriority
) -> Result<(), Error>Expand description
Sets thread’s priority and schedule policy using WinAPI priority values.
- May require privileges
Usage
Setting thread priority to minimum:
use thread_priority::*;
let thread_id = thread_native_id();
assert!(set_winapi_thread_priority(thread_id, WinAPIThreadPriority::Normal).is_ok());If there’s an error, a result of
GetLastError is returned.