thread_priority::windows

Function set_thread_priority

Source
pub fn set_thread_priority(
    native: ThreadId,
    priority: ThreadPriority,
) -> Result<(), Error>
Expand description

Sets thread’s priority and schedule policy.

  • May require privileges

§Usage

Setting thread priority to minimum:

use thread_priority::*;

let thread_id = thread_native_id();
assert!(set_thread_priority(thread_id, ThreadPriority::Min).is_ok());

If there’s an error, a result of GetLastError is returned.