C# Thread class
C# Thread class provides properties and methods to create and control threads. It is found in System.Threading namespace.
C# Thread Properties
A list of important properties of Thread class are given below:
|returns the instance of currently running thread.
|checks whether the current thread is alive or not. It is used to find the execution status of the thread.
|is used to get or set value whether current thread is in background or not.
|is used to get unique id for the current managed thread.
|is used to get or set the name of the current thread.
|is used to get or set the priority of the current thread.
|is used to return a value representing the thread state.
C# Thread Methods
A list of important methods of Thread class are given below:
|is used to terminate the thread. It raises ThreadAbortException.
|is used to interrupt a thread which is in WaitSleepJoin state.
|is used to block all the calling threads until this thread terminates.
|is used to cancel the Abort request for the current thread.
|is used to resume the suspended thread. It is obselete.
|is used to suspend the current thread for the specified milliseconds.
|changes the current state of the thread to Runnable.
|suspends the current thread if it is not suspended. It is obselete.
|is used to yield the execution of current thread to another thread.