DtsContainer.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 で新しいスレッドが開始されないことを意味します。このインターフェイスを実装する必要はありません。 カスタム タスクの記述の詳細については、「カスタム タスク の開発」を参照してください。

適用対象