System.Threading.Thread Members

The members of System.Threading.Thread are listed below.

See Also: Inherited members from System.Runtime.ConstrainedExecution.CriticalFinalizerObject

Public Constructors

Initializes a new instance of the System.Threading.Thread class, specifying a delegate that allows an object to be passed to the thread when the thread is started.

Initializes a new instance of the System.Threading.Thread class.

Initializes a new instance of the System.Threading.Thread class, specifying a delegate that allows an object to be passed to the thread when the thread is started and specifying the maximum stack size for the thread.

Initializes a new instance of the System.Threading.Thread class, specifying the maximum stack size for the thread.

Public Properties

ApartmentStateSystem.Threading.ApartmentState.

Gets or sets the apartment state of this thread.

[read-only]
static
CurrentContextSystem.Runtime.Remoting.Contexts.Context.

Gets the current context in which the thread is executing.

CurrentCultureSystem.Globalization.CultureInfo.

Gets or sets the culture for the current thread.

static
CurrentPrincipalSystem.Security.Principal.IPrincipal.

Gets or sets the thread's current principal (for role-based security).

[read-only]
static
CurrentThreadSystem.Threading.Thread.

Gets the currently running thread.

CurrentUICultureSystem.Globalization.CultureInfo.

Gets or sets the current culture used by the Resource Manager to look up culture-specific resources at run time.

[read-only]
ExecutionContextSystem.Threading.ExecutionContext.

Gets an System.Threading.ExecutionContext object that contains information about the various contexts of the current thread.

[read-only]
IsAlivebool.

Gets a value indicating the execution status of the current thread.

IsBackgroundbool.

Gets or sets a value indicating whether or not a thread is a background thread.

[read-only]
IsThreadPoolThreadbool.

Gets a value indicating whether or not a thread belongs to the managed thread pool.

[read-only]
ManagedThreadIdint.

Gets a unique identifier for the current managed thread.

Namestring.

Gets or sets the name of the thread.

PrioritySystem.Threading.ThreadPriority.

Gets or sets a value indicating the scheduling priority of a thread.

[read-only]
ThreadStateSystem.Threading.ThreadState.

Gets a value containing the states of the current thread.

Public Methods

Abort()

Raises a System.Threading.ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread. Calling this method usually terminates the thread.

Abort(object)

Raises a System.Threading.ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread while also providing exception information about the thread termination. Calling this method usually terminates the thread.

static
AllocateDataSlot() : LocalDataStoreSlot

Allocates an unnamed data slot on all the threads. For better performance, use fields that are marked with the ThreadStaticAttribute attribute instead.

static
AllocateNamedDataSlot(string) : LocalDataStoreSlot

Allocates a named data slot on all threads. For better performance, use fields that are marked with the ThreadStaticAttribute attribute instead.

static
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.

static
BeginThreadAffinity()

Notifies a host that managed code is about to execute instructions that depend on the identity of the current physical operating system thread.

static
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.

static
EndThreadAffinity()

Notifies a host that managed code has finished executing instructions that depend on the identity of the current physical operating system thread.

Finalize()
Releases the resources held by this instance.
static
FreeNamedDataSlot(string)

Eliminates the association between a name and a slot, for all threads in the process. For better performance, use fields that are marked with the ThreadStaticAttribute attribute instead.

GetApartmentState() : System.Threading.ApartmentState

Returns an System.Threading.ApartmentState value indicating the apartment state.

GetCompressedStack() : System.Threading.CompressedStack

Returns a System.Threading.CompressedStack object that can be used to capture the stack for the current thread.

static
GetData(LocalDataStoreSlot) : object

Retrieves the value from the specified slot on the current thread, within the current thread's current domain. For better performance, use fields that are marked with the ThreadStaticAttribute attribute instead.

static
GetDomain() : AppDomain

Returns the current domain in which the current thread is running.

static
GetDomainID() : int

Returns a unique application domain identifier.

override
GetHashCode() : int

Returns a hash code for the current thread.

static
GetNamedDataSlot(string) : LocalDataStoreSlot

Looks up a named data slot. For better performance, use fields that are marked with the ThreadStaticAttribute attribute instead.

Interrupt()

Interrupts a thread that is in the WaitSleepJoin thread state.

Join()

Blocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping.

Join(int) : bool

Blocks the calling thread until a thread terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.

Join(TimeSpan) : bool

Blocks the calling thread until a thread terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.

static
MemoryBarrier()

Synchronizes memory access as follows: The processor executing the current thread cannot reorder instructions in such a way that memory accesses prior to the call to Thread.MemoryBarrier execute after memory accesses that follow the call to Thread.MemoryBarrier.

static
ResetAbort()

Cancels an Thread.Abort(object) requested for the current thread.

Resume()

Resumes a thread that has been suspended.

SetApartmentState(System.Threading.ApartmentState)

Sets the apartment state of a thread before it is started.

SetCompressedStack(System.Threading.CompressedStack)

Applies a captured System.Threading.CompressedStack to the current thread.

static
SetData(LocalDataStoreSlot, object)

Sets the data in the specified slot on the currently running thread, for that thread's current domain. For better performance, use fields marked with the ThreadStaticAttribute attribute instead.

static
Sleep(int)

Suspends the current thread for the specified number of milliseconds.

static
Sleep(TimeSpan)

Suspends the current thread for the specified amount of time.

static
SpinWait(int)

Causes a thread to wait the number of times defined by the iterations parameter.

Start()

Causes the operating system to change the state of the current instance to ThreadState.Running.

Start(object)

Causes the operating system to change the state of the current instance to ThreadState.Running, and optionally supplies an object containing data to be used by the method the thread executes.

Suspend()

Either suspends the thread, or if the thread is already suspended, has no effect.

TrySetApartmentState(System.Threading.ApartmentState) : bool

Sets the apartment state of a thread before it is started.

static
VolatileRead(ref byte) : byte
Performs a volatile read from the specified address.
static
VolatileRead(ref double) : double
Performs a volatile read from the specified address.
static
VolatileRead(ref short) : short
Performs a volatile read from the specified address.
static
VolatileRead(ref int) : int
Performs a volatile read from the specified address.
static
VolatileRead(ref long) : long
Performs a volatile read from the specified address.
static
VolatileRead(ref IntPtr) : IntPtr
Performs a volatile read from the specified address.
static
VolatileRead(ref object) : object
Performs a volatile read from the specified address.
static
VolatileRead(ref sbyte) : sbyte
Performs a volatile read from the specified address.
static
VolatileRead(ref float) : float
Performs a volatile read from the specified address.
static
VolatileRead(ref ushort) : ushort
Performs a volatile read from the specified address.
static
VolatileRead(ref uint) : uint
Performs a volatile read from the specified address.
static
VolatileRead(ref ulong) : ulong
Performs a volatile read from the specified address.
static
VolatileRead(ref UIntPtr) : UIntPtr
Performs a volatile read from the specified address.
static
VolatileWrite(ref byte, byte)
Performs a volatile write to the specified address.
static
VolatileWrite(ref double, double)
Performs a volatile write to the specified address.
static
VolatileWrite(ref short, short)
Performs a volatile write to the specified address.
static
VolatileWrite(ref int, int)
Performs a volatile write to the specified address.
static
VolatileWrite(ref long, long)
Performs a volatile write to the specified address.
static
VolatileWrite(ref IntPtr, IntPtr)
Performs a volatile write to the specified address.
static
VolatileWrite(ref object, object)
Performs a volatile write to the specified address.
static
VolatileWrite(ref sbyte, sbyte)
Performs a volatile write to the specified address.
static
VolatileWrite(ref float, float)
Performs a volatile write to the specified address.
static
VolatileWrite(ref ushort, ushort)
Performs a volatile write to the specified address.
static
VolatileWrite(ref uint, uint)
Performs a volatile write to the specified address.
static
VolatileWrite(ref ulong, ulong)
Performs a volatile write to the specified address.
static
VolatileWrite(ref UIntPtr, UIntPtr)
Performs a volatile write to the specified address.
static
Yield() : bool

Causes the calling thread to yield execution to another thread that is ready to run on the current processor. The operating system selects the thread to yield to.

Explicitly Implemented Interface Members

System.Runtime.InteropServices._Thread.GetIDsOfNamesDocumentation for this section has not yet been entered.
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.GetTypeInfoCountDocumentation for this section has not yet been entered.
System.Runtime.InteropServices._Thread.InvokeDocumentation for this section has not yet been entered.