WmiDataReaderTask.SuspendExecution 메서드

정의

실행 파일을 일시 중지해야 함을 나타냅니다. 이 메서드는 런타임 엔진을 통해 호출됩니다.

public:
 virtual void SuspendExecution();
public void SuspendExecution ();
abstract member SuspendExecution : unit -> unit
override this.SuspendExecution : unit -> unit
Public Sub SuspendExecution ()

구현

예제

다음 코드 예제는 사용자 지정 작업에 대해 재정의된 SuspendExecution 메서드의 예입니다.

public void SuspendExecution()   
{  
    lock (this)   
    {  
        // If a suspend is required, do it.   
        if (m_suspendRequired != 0)   
           ChangeEvent(m_canExecute, false);   
        }   

        // The application cannot return from Suspend until the task  
        // is suspended.  
        // This can happen in one of two ways:  
        // 1) The m_suspended event occurs, indicating that the   
        // execute thread has suspended, or   
        // 2) the canExecute flag is set, indicating that a suspend is  
        // no longer required.   
        WaitHandle [] suspendOperationComplete = {m_suspended, m_canExecute};  
        WaitHandle.WaitAny(suspendOperationComplete);  
}  
Public  Sub SuspendExecution()  
    lock (Me)  
    {  
        If m_suspendRequired <> 0 Then  
           ChangeEvent(m_canExecute, False)  
        End If  
    }  
        ' The application cannot return from Suspend until the task  
        ' is suspended. This can happen in one of two ways:  
        ' 1) The m_suspended event occurs, indicating that the   
        ' execute thread has suspended, or   
        ' 2) the canExecute flag is set, indicating that a suspend is  
        ' no longer required.   
        Dim suspendOperationComplete As WaitHandle() = {m_suspended, m_canExecute}  
        WaitHandle.WaitAny(suspendOperationComplete)  

설명

이 메서드는 코드에서 사용되지 않습니다. 중단점이 발견되면 런타임에서 호출합니다.

그러나 중단점을 노출하는 다중 스레드 사용자 지정 작업을 작성하는 경우 클래스에서 IDTSSuspend 상속되는 이 메서드에 대한 코드를 제공해야 합니다. 태스크가 단일 스레드인 경우 이는 사용자 지정 태스크의 Execute 구현이 새 스레드를 시작하지 않는다는 것을 의미하며, 이 인터페이스를 구현할 필요가 없습니다. 사용자 지정 작업을 작성하는 방법에 대한 자세한 내용은 사용자 지정 작업 개발을 참조하세요.

적용 대상