다음을 통해 공유


Thread.CurrentThread 속성

현재 실행 중인 스레드를 가져옵니다.

네임스페이스: System.Threading
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Shared ReadOnly Property CurrentThread As Thread
‘사용 방법
Dim value As Thread

value = Thread.CurrentThread
public static Thread CurrentThread { get; }
public:
static property Thread^ CurrentThread {
    Thread^ get ();
}
/** @property */
public static Thread get_CurrentThread ()
public static function get CurrentThread () : Thread

속성 값

현재 실행 중인 스레드를 나타내는 Thread입니다.

예제

이 코드 예제는 IsThreadPoolThread 속성에 대해 제공되는 보다 큰 예제의 일부입니다.

Shared Sub ThreadMethod()
    Console.WriteLine("ThreadOne, executing ThreadMethod, " & _
        "is from the thread pool? {0}", _
        Thread.CurrentThread.IsThreadPoolThread)
End Sub
static void ThreadMethod()
{
    Console.WriteLine("ThreadOne, executing ThreadMethod, " +
        "is {0}from the thread pool.", 
        Thread.CurrentThread.IsThreadPoolThread ? "" : "not ");
}
static void ThreadMethod()
{
   Console::WriteLine( "ThreadOne, executing ThreadMethod, "
   "is {0}from the thread pool.", Thread::CurrentThread->IsThreadPoolThread ? (String^)"" : "not " );
}

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Thread 클래스
Thread 멤버
System.Threading 네임스페이스