thread_priority::windows

Function set_current_thread_priority

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

Set current thread’s priority.

  • May require privileges

§Usage

Setting thread priority to minimum:

use thread_priority::*;

assert!(set_current_thread_priority(ThreadPriority::Min).is_ok());
assert!(set_current_thread_priority(ThreadPriority::Os(WinAPIThreadPriority::Lowest.into())).is_ok());

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