Thread Members
.NET Framework 2.0
Creates and controls a thread, sets its priority, and gets its status.
The following tables list the members exposed by the Thread type.
| Name | Description | |
|---|---|---|
| ApartmentState | Gets or sets the apartment state of this thread. |
| CurrentContext | Gets the current context in which the thread is executing. |
| CurrentCulture | Gets or sets the culture for the current thread. |
| CurrentPrincipal | Gets or sets the thread's current principal (for role-based security). |
| CurrentThread | Gets the currently running thread. |
| CurrentUICulture | Gets or sets the current culture used by the Resource Manager to look up culture-specific resources at run time. |
| ExecutionContext | Gets an ExecutionContext object that contains information about the various contexts of the current thread. |
| IsAlive | Gets a value indicating the execution status of the current thread. |
| IsBackground | Gets or sets a value indicating whether or not a thread is a background thread. |
| IsThreadPoolThread | Gets a value indicating whether or not a thread belongs to the managed thread pool. |
| ManagedThreadId | Gets a unique identifier for the current managed thread. |
| Name | Gets or sets the name of the thread. |
| Priority | Gets or sets a value indicating the scheduling priority of a thread. |
| ThreadState | Gets a value containing the states of the current thread. |
| Name | Description | |
|---|---|---|
| Abort | Overloaded. Raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread. Calling this method usually terminates the thread. |
| AllocateDataSlot | Allocates an unnamed data slot on all the threads. |
| AllocateNamedDataSlot | Allocates a named data slot on all threads. |
| BeginCriticalRegion | Notifies a host that execution is about to enter a region of code in which the effects of a thread abort or unhandled exception might jeopardize other tasks in the application domain. |
| BeginThreadAffinity | Notifies a host that managed code is about to execute instructions that depend on the identity of the current physical operating system thread. |
| EndCriticalRegion | Notifies a host that execution is about to enter a region of code in which the effects of a thread abort or unhandled exception are limited to the current task. |
| EndThreadAffinity | Notifies a host that managed code has finished executing instructions that depend on the identity of the current physical operating system thread. |
| Equals | Overloaded. Determines whether two Object instances are equal. (Inherited from Object.) |
| FreeNamedDataSlot | Eliminates the association between a name and a slot, for all threads in the process. |
| GetApartmentState | Returns an ApartmentState value indicating the apartment state. |
| GetCompressedStack | Returns a CompressedStack object that can be used to capture the stack for the current thread. |
| GetData | Retrieves the value from the specified slot on the current thread, within the current thread's current domain. |
| GetDomain | Returns the current domain in which the current thread is running. |
| GetDomainID | Returns a unique application domain identifier. |
| GetHashCode | Overridden. Returns a hash code for the current thread. |
| GetNamedDataSlot | Looks up a named data slot. |
| GetType | Gets the Type of the current instance. (Inherited from Object.) |
| Interrupt | Interrupts a thread that is in the WaitSleepJoin thread state. |
| Join | Overloaded. Blocks the calling thread until a thread terminates. |
| MemoryBarrier | Synchronizes memory. In effect, flushes the contents of cache memory to main memory, for the processor executing the current thread. |
| ReferenceEquals | Determines whether the specified Object instances are the same instance. (Inherited from Object.) |
| ResetAbort | Cancels an Abort requested for the current thread. |
| Resume | Resumes a thread that has been suspended. |
| SetApartmentState | Sets the apartment state of a thread before it is started. |
| SetCompressedStack | Applies a captured CompressedStack to the current thread. |
| SetData | Sets the data in the specified slot on the currently running thread, for that thread's current domain. |
| Sleep | Overloaded. Blocks the current thread for the specified number of milliseconds. |
| SpinWait | Causes a thread to wait the number of times defined by the iterations parameter. |
| Start | Overloaded. Causes a thread to be scheduled for execution. |
| Suspend | Either suspends the thread, or if the thread is already suspended, has no effect. |
| ToString | Returns a String that represents the current Object. (Inherited from Object.) |
| TrySetApartmentState | Sets the apartment state of a thread before it is started. |
| VolatileRead | Overloaded. Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. |
| VolatileWrite | Overloaded. Writes a value to a field immediately, so that the value is visible to all processors in the computer. |
| Name | Description | |
|---|---|---|
| System.Runtime.InteropServices._Thread.GetIDsOfNames | Maps a set of names to a corresponding set of dispatch identifiers. |
| System.Runtime.InteropServices._Thread.GetTypeInfo | Retrieves the type information for an object, which can then be used to get the type information for an interface. |
| System.Runtime.InteropServices._Thread.GetTypeInfoCount | Retrieves the number of type information interfaces that an object provides (either 0 or 1). |
| System.Runtime.InteropServices._Thread.Invoke | Provides access to properties and methods exposed by an object. |
Reference
Thread ClassSystem.Threading Namespace
Other Resources
Threads and ThreadingUsing Threads and Threading