A Thread class is responsible for creating and managing a thread in multi-thread programming. It provides a property known as
IsThreadPoolThread to check if the thread belongs to the managed thread pool or not.
Syntax:
public bool IsThreadPoolThread { get; }
Return Value: This property returns
true if the given thread belongs to the managed thread pool. Otherwise, return
false. The return type of this property is
System.Boolean.
Below programs illustrate the use of
IsThreadPoolThread property:
Example 1:
Output:
Is main thread belongs to Thread pool? : False
Example 2: