PosixSignalRegistration.Create 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
handler
註冊發生 時所叫用的 signal
。
public:
static System::Runtime::InteropServices::PosixSignalRegistration ^ Create(System::Runtime::InteropServices::PosixSignal signal, Action<System::Runtime::InteropServices::PosixSignalContext ^> ^ handler);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static System.Runtime.InteropServices.PosixSignalRegistration Create (System.Runtime.InteropServices.PosixSignal signal, Action<System.Runtime.InteropServices.PosixSignalContext> handler);
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member Create : System.Runtime.InteropServices.PosixSignal * Action<System.Runtime.InteropServices.PosixSignalContext> -> System.Runtime.InteropServices.PosixSignalRegistration
Public Shared Function Create (signal As PosixSignal, handler As Action(Of PosixSignalContext)) As PosixSignalRegistration
參數
- signal
- PosixSignal
要註冊的訊號。
- handler
- Action<PosixSignalContext>
叫用的處理程式。
傳回
PosixSignalRegistration可以處置以取消註冊處理程序的實例。
- 屬性
例外狀況
handler
為 null
。
signal
平臺不支援。
設定訊號處理或安裝指定訊號的處理程式時發生錯誤。
備註
您可以將原始值轉換成 PosixSignal,在 Unix 上提供signal
原始值。
您可以透過 Cancel取消訊號的默認處理。
SIGINT 和 SIGQUIT 可以在 Windows 和 Unix 平臺上取消; SIGTERM 只能在 Unix 上取消。
在 Unix 上,可以取消和 SIGCONT的SIGCHLD終端機組態。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應