IsThreadPoolThread Property

Thread.IsThreadPoolThread Property


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

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)

public bool IsThreadPoolThread { get; }

Property Value

Type: System.Boolean

true if this thread belongs to the managed thread pool; otherwise, false.

For more information see The Managed Thread Pool.

The following code example shows how to determine whether a thread is from the thread pool.

using System;
using System.Threading;

class IsThreadPool
    static void Main()
        AutoResetEvent autoEvent = new AutoResetEvent(false);

        Thread regularThread = 
            new Thread(new ThreadStart(ThreadMethod));
        ThreadPool.QueueUserWorkItem(new WaitCallback(WorkMethod), 

        // Wait for foreground thread to end.

        // Wait for background thread to end.

    static void ThreadMethod()
        Console.WriteLine("ThreadOne, executing ThreadMethod, " +
            "is {0}from the thread pool.", 
            Thread.CurrentThread.IsThreadPoolThread ? "" : "not ");

    static void WorkMethod(object stateInfo)
        Console.WriteLine("ThreadTwo, executing WorkMethod, " +
            "is {0}from the thread pool.", 
            Thread.CurrentThread.IsThreadPoolThread ? "" : "not ");

        // Signal that this thread is finished.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft