pub struct Thread { /* private fields */ }
Available on crate feature
process
only.Expand description
A thread inside a Windows process.
Implementations§
Source§impl Thread
impl Thread
Sourcepub fn current() -> Self
pub fn current() -> Self
Constructs a special handle that always points to the current thread.
When transferred to a different thread, it will point to that thread when used from it.
Sourcepub fn from_id<I>(id: I) -> Result<Self>
pub fn from_id<I>(id: I) -> Result<Self>
Tries to acquire a thread handle from an ID.
This may fail due to insufficient access rights.
Sourcepub fn begin_background_mode() -> Result<()>
pub fn begin_background_mode() -> Result<()>
Sets the current thread to background processing mode.
This will also lower the I/O priority of the thread, which will lower the impact of heavy disk I/O on other threads and processes.
Sourcepub fn end_background_mode() -> Result<()>
pub fn end_background_mode() -> Result<()>
Ends background processing mode for the current thread.
Sourcepub fn set_priority(&mut self, priority: ThreadPriority) -> Result<(), Error>
pub fn set_priority(&mut self, priority: ThreadPriority) -> Result<(), Error>
Sets the priority of the thread.
§Examples
use winapi_easy::process::{Thread, ThreadPriority};
Thread::current().set_priority(ThreadPriority::Normal)?;
pub fn get_id(&self) -> ThreadId
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Thread
impl RefUnwindSafe for Thread
impl !Send for Thread
impl !Sync for Thread
impl Unpin for Thread
impl UnwindSafe for Thread
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more