HostProtectionAttribute.ExternalThreading 속성

정의

외부 스레딩이 노출되는지 여부를 나타내는 값을 가져오거나 설정합니다.Gets or sets a value indicating whether external threading is exposed.

public:
 property bool ExternalThreading { bool get(); void set(bool value); };
public bool ExternalThreading { get; set; }
member this.ExternalThreading : bool with get, set
Public Property ExternalThreading As Boolean

속성 값

Boolean

외부 스레딩이 노출되면 true이고, 그렇지 않으면 false입니다.true if external threading is exposed; otherwise, false. 기본값은 false입니다.The default is false.

예제

다음 코드 예제에서는 속성을 사용 하 여 특성을 사용 하는 방법을 보여 줍니다 HostProtectionAttribute ExternalThreading .The following code example illustrates the use of the HostProtectionAttribute attribute with the ExternalThreading property. 이 예제는에 대해 제공 된 큰 예제의 일부는 HostProtectionAttribute 클래스입니다.This example is part of a larger example provided for the HostProtectionAttribute class.

// Use the enumeration flags to indicate that this method exposes synchronization 
//  and external threading.

[HostProtection(Synchronization=true,ExternalThreading=true)]
static void StartThread()
{
   Thread^ t = gcnew Thread( gcnew ThreadStart( WatchFileEvents ) );
   
   // Start the new thread.  On a uniprocessor, the thread is not given 
   // any processor time until the main thread yields the processor.  
   t->Start();
   
   // Give the new thread a chance to execute.
   Thread::Sleep( 1000 );
}
// Use the enumeration flags to indicate that this method exposes 
// synchronization and external threading.
[HostProtectionAttribute(Synchronization=true, ExternalThreading=true)]
private static void StartThread()
{
    Thread t = new Thread(new ThreadStart(WatchFileEvents));
    
    // Start the new thread. On a uniprocessor, the thread is not given
    // any processor time until the main thread yields the processor.
    t.Start();
    
    // Give the new thread a chance to execute.
    Thread.Sleep(1000);
}
' Use the enumeration flags to indicate that this method exposes  
' synchronization and external threading.
<HostProtectionAttribute(Synchronization := True, _
    ExternalThreading := True)> _
Private Shared Sub StartThread()
    Dim t As New Thread(New ThreadStart(AddressOf WatchFileEvents))

    ' Start the new thread. On a uniprocessor, the thread is not given 
    ' any processor time until the main thread yields the processor.  
    t.Start()

    ' Give the new thread a chance to execute.
    Thread.Sleep(1000)
End Sub

설명

외부 스레딩을 노출 하는 코드는 자체 이외의 스레드를 만들거나 조작 하며,이는 호스트에 유해한 것일 수 있습니다.Code that exposes external threading creates or manipulates threads other than its own, which might be harmful to the host.

적용 대상

추가 정보