Thread.ResetAbort 方法

定義

警告

Thread.ResetAbort is not supported and throws PlatformNotSupportedException.

取消為目前執行緒要求的 Abort(Object)

public:
 static void ResetAbort();
public static void ResetAbort ();
[System.Obsolete("Thread.ResetAbort is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static void ResetAbort ();
static member ResetAbort : unit -> unit
[<System.Obsolete("Thread.ResetAbort is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ResetAbort : unit -> unit
Public Shared Sub ResetAbort ()
屬性

例外狀況

僅限 .NET Core 與 .NET 5+:在所有情況下。

Abort 不是在目前執行緒上所叫用。

呼叫端沒有目前執行緒的必要安全性權限。

備註

這個方法只能由具有適當許可權的程式碼呼叫。

Abort呼叫 以終止執行緒時,系統會擲回 ThreadAbortExceptionThreadAbortException 是可由應用程式程式碼攔截的特殊例外狀況,但除非 ResetAbort 呼叫 ,否則會在 catch 區塊結尾重新擲回。 ResetAbort 取消中止的要求,並防止 ThreadAbortException 終止執行緒。

如需示範呼叫 方法的 ResetAbort 範例,請參閱 ThreadAbortException

適用於

另請參閱