다음을 통해 공유


방법: 관리 코드에 스레드 이름 설정

업데이트: 2007년 11월

이 항목은 다음 언어에 적용됩니다.

Edition

Visual Basic

C#

C++

Web Developer

Express

항목이 적용되지 않음 항목이 적용되지 않음 항목이 적용되지 않음 항목이 적용되지 않음

Standard

항목이 적용됨 항목이 적용됨

항목이 적용됨

항목이 적용됨

Pro 및 Team

항목이 적용됨

항목이 적용됨

항목이 적용됨

항목이 적용됨

표의 범례:

항목이 적용됨

해당

항목이 적용되지 않음

해당 없음

항목이 적용되지만 명령은 기본적으로 숨겨짐

명령은 기본적으로 숨겨져 있습니다.

관리 코드에 스레드 이름을 설정하려면 [System.Threading.Thread.Name] 속성을 사용합니다.

예제

Public Class Needle
    ' This method will be called when the thread is started.
    Sub Baz()
        Console.WriteLine("Needle Baz is running on another thread")
    End Sub
End Class

Sub Main()
    Console.WriteLine("Thread Simple Sample")
    Dim oNeedle As New Needle()
   ' Create a Thread object. 
    Dim oThread As New System.Threading.Thread(AddressOf oNeedle.Baz)
    ' Set the Thread name to "MainThread".
    oThread.Name = "MainThread"
    ' Starting the thread invokes the ThreadStart delegate
    oThread.Start()
End Sub

참고 항목

작업

방법: 네이티브 코드에 스레드 이름 설정

기타 리소스

다중 스레드 응용 프로그램 디버깅