次の方法で共有


DtsContainer.SuspendExecution Method

実行可能ファイルを中断する必要がある場合に呼び出されます。このメソッドはランタイム エンジンで呼び出されます。

名前空間: Microsoft.SqlServer.Dts.Runtime
アセンブリ: Microsoft.SqlServer.ManagedDTS (microsoft.sqlserver.manageddts.dll 内)

構文

'宣言
Public Sub SuspendExecution
public void SuspendExecution ()
public:
virtual void SuspendExecution () sealed
public final void SuspendExecution ()
public final function SuspendExecution ()

解説

このメソッドはコードでは使用されません。ブレークポイントに到達したときにランタイムで呼び出されます。

ただし、ブレークポイントを公開するマルチスレッド カスタム タスクを作成する場合は、IDTSSuspend クラスから継承されるこのメソッドのコードを指定する必要があります。タスクがシングル スレッドであり、カスタム タスクで Execute を実装しても新しいスレッドが起動されない場合は、このインターフェイスを実装する必要はありません。カスタム タスクの作成の詳細については、「カスタム タスクの開発」を参照してください。

使用例

次のコードは、カスタム タスクのオーバーライドされた 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)

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

DtsContainer Class
DtsContainer Members
Microsoft.SqlServer.Dts.Runtime Namespace