System.Threading.Thread: Method Members

The methods of System.Threading.Thread are listed below. For a list of all members, see the Thread Members list.

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

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.