言語

PosixSignalRegistration.Create メソッド

定義

signalが発生したときに呼び出されるhandlerを登録します。

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 インスタンス。

属性

例外

handlernullです。

signal はプラットフォームではサポートされていません。

シグナル処理の設定中、または指定されたシグナルのハンドラーのインストール中にエラーが発生しました。

注釈

Unix 上の signal に生の値を指定するには、 PosixSignalにキャストします。 信号のデフォルトの処理は、 Cancelを介して取り消すことができます。 SIGINT および SIGQUIT は、Windows および Unix プラットフォームの両方で取り消すことができます。SIGTERM は Unix でのみ取り消すことができます。 Unix では、 SIGCHLD および SIGCONTのターミナル構成を取り消すことができます。 .NET 10 以降のバージョンでは、ハンドラーは登録の逆の順序で実行されます。

適用対象