Struct winproc::Thread[][src]

pub struct Thread { /* fields omitted */ }

A handle to a running thread.

Methods

impl Thread
[src]

Creates a thread handle from a thread ID.

Return's the thread's ID.

Returns the thread's cycle time.

Returns the thread's ideal processor.

Sets the thread's ideal processor. On success, returns the previous ideal processor.

Returns the thread's current affinity mask.

Sets the affinity mask of the thread. On success, returns the previous affinity mask.

A thread affinity mask is a bit vector in which each bit represents a logical processor that a thread is allowed to run on. A thread affinity mask must be a subset of the process affinity mask for the containing process of a thread. A thread can only run on the processors its process can run on. Therefore, the thread affinity mask cannot specify a 1 bit for a processor when the process affinity mask specifies a 0 bit for that processor.

Setting an affinity mask for a process or thread can result in threads receiving less processor time, as the system is restricted from running the threads on certain processors. In most cases, it is better to let the system select an available processor.

If the new thread affinity mask does not specify the processor that is currently running the thread, the thread is rescheduled on one of the allowable processors.

Sets the affinity of the thread to the single specified processor.

If the processor index equals or exceeds the width of usize, the mask is not changed. On success, or if unchanged, returns the previous affinity mask.

Trait Implementations

impl Debug for Thread
[src]

Formats the value using the given formatter. Read more

impl AsRawHandle for Thread
[src]

Extracts the raw handle, without taking any ownership.

impl Deref for Thread
[src]

The resulting type after dereferencing.

Dereferences the value.

impl FromRawHandle for Thread
[src]

Constructs a new I/O object from the specified raw handle. Read more

impl IntoRawHandle for Thread
[src]

Consumes this object, returning the raw underlying handle. Read more

Auto Trait Implementations

impl !Send for Thread

impl !Sync for Thread