Udostępnij za pośrednictwem


Metoda Exec80PackageTask.SuspendExecution

Wywoływane, gdy plik wykonywalny musi zawiesić.Ta metoda jest wywoływana przez aparatu wykonawczego.

Przestrzeń nazw:  Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask
Zestaw:  Microsoft.SqlServer.Exec80PackageTask (w Microsoft.SqlServer.Exec80PackageTask.dll)

Składnia

'Deklaracja
Public Sub SuspendExecution
'Użycie
Dim instance As Exec80PackageTask

instance.SuspendExecution()
public void SuspendExecution()
public:
virtual void SuspendExecution() sealed
abstract SuspendExecution : unit -> unit 
override SuspendExecution : unit -> unit 
public final function SuspendExecution()

Implementacje

IDTSSuspend.SuspendExecution()

Uwagi

Ta metoda nie jest używany w kodzie.Go ono wywoływane w czasie wykonywania, gdy napotkał punkt przerwania .

Jednakże należy podać kod dla tej metoda, która jest dziedziczona z IDTSSuspend klasy, jeśli piszesz wielowątkowych zadanie niestandardowe miejscami punkty przerwania.Jeśli zadanie jest pojedynczym wątku, co oznacza, że implementacji Execute w niestandardowe zadania nie można uruchomić nowych wątków, nie trzeba implementuje ten interfejs.Aby uzyskać więcej informacji na temat pisania niestandardowych zadań, zobacz Opracowywania niestandardowego zadania.

Przykłady

Poniższy przykład kodu jest przykładem zastąpiona SuspendExecution metoda dla niestandardowego zadania.

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)