Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

Thread Methods

The Thread type exposes the following members.

  Name Description
Public method Abort() 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.
Public method Abort(Object) Raises a 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.
Public method Static member AllocateDataSlot Allocates an unnamed data slot on all the threads. For better performance, use fields that are marked with the ThreadStaticAttribute attribute instead.
Public method Static member AllocateNamedDataSlot Allocates a named data slot on all threads. For better performance, use fields that are marked with the ThreadStaticAttribute attribute instead.
Public method Static member 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.
Public method Static member BeginThreadAffinity Notifies a host that managed code is about to execute instructions that depend on the identity of the current physical operating system thread.
Public method DisableComObjectEagerCleanup Turns off automatic cleanup of runtime callable wrappers (RCW) for the current thread.
Public method Static member 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.
Public method Static member EndThreadAffinity Notifies a host that managed code has finished executing instructions that depend on the identity of the current physical operating system thread.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method Static member FreeNamedDataSlot 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.
Public method GetApartmentState Returns an ApartmentState value indicating the apartment state.
Public method GetCompressedStack Obsolete. Returns a CompressedStack object that can be used to capture the stack for the current thread.
Public method Static member GetData 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.
Public method Static member GetDomain Returns the current domain in which the current thread is running.
Public method Static member GetDomainID Returns a unique application domain identifier.
Public method GetHashCode Returns a hash code for the current thread. (Overrides Object.GetHashCode().)

In XNA Framework 3.0, this member is inherited from Object.GetHashCode().


In Portable Class Library Portable Class Library, this member is inherited from Object.GetHashCode().
Public method Static member GetNamedDataSlot Looks up a named data slot. For better performance, use fields that are marked with the ThreadStaticAttribute attribute instead.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Interrupt Interrupts a thread that is in the WaitSleepJoin thread state.
Public method Join() Blocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping.
Public method Join(Int32) Blocks the calling thread until a thread terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.
Public method Join(TimeSpan) Blocks the calling thread until a thread terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.
Public method Static member 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 MemoryBarrier execute after memory accesses that follow the call to MemoryBarrier.
Public method Static member ResetAbort Cancels an Abort requested for the current thread.
Public method Resume Obsolete. Resumes a thread that has been suspended.
Public method SetApartmentState Sets the apartment state of a thread before it is started.
Public method SetCompressedStack Obsolete. Applies a captured CompressedStack to the current thread.
Public method Static member SetData 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.
Public method SetProcessorAffinity In the .NET Compact Framework for Xbox 360, sets the processor affinity for a managed thread. Processor affinity determines the processors on which a thread runs.
Public method Static member Sleep(Int32) Suspends the current thread for the specified number of milliseconds.
Public method Static member Sleep(TimeSpan) Suspends the current thread for the specified amount of time.
Public method Static member SpinWait Causes a thread to wait the number of times defined by the iterations parameter.
Public method Start() Causes the operating system to change the state of the current instance to ThreadState.Running.
Public method 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.
Public method Suspend Obsolete. Either suspends the thread, or if the thread is already suspended, has no effect.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method TrySetApartmentState Sets the apartment state of a thread before it is started.
Public method Static member VolatileRead(Byte) 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.
Public method Static member VolatileRead(Double) 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.
Public method Static member VolatileRead(Int16) 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.
Public method Static member VolatileRead(Int32) 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.
Public method Static member VolatileRead(Int64) 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.
Public method Static member VolatileRead(IntPtr) 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.
Public method Static member VolatileRead(Object) 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.
Public method Static member VolatileRead(SByte) 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.
Public method Static member VolatileRead(Single) 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.
Public method Static member VolatileRead(UInt16) 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.
Public method Static member VolatileRead(UInt32) 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.
Public method Static member VolatileRead(UInt64) 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.
Public method Static member VolatileRead(UIntPtr) 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.
Public method Static member VolatileWrite(Byte, Byte) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(Double, Double) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(Int16, Int16) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(Int32, Int32) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(Int64, Int64) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(IntPtr, IntPtr) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(Object, Object) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(SByte, SByte) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(Single, Single) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(UInt16, UInt16) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(UInt32, UInt32) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(UInt64, UInt64) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member VolatileWrite(UIntPtr, UIntPtr) Writes a value to a field immediately, so that the value is visible to all processors in the computer.
Public method Static member Yield 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.
Top
  Name Description
Explicit interface implemetation Private method _Thread.GetIDsOfNames Maps a set of names to a corresponding set of dispatch identifiers.
Explicit interface implemetation Private method _Thread.GetTypeInfo Retrieves the type information for an object, which can then be used to get the type information for an interface.
Explicit interface implemetation Private method _Thread.GetTypeInfoCount Retrieves the number of type information interfaces that an object provides (either 0 or 1).
Explicit interface implemetation Private method _Thread.Invoke Provides access to properties and methods exposed by an object.
Top
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.