SignalNotifier SignalNotifier SignalNotifier SignalNotifier Class

Definition

Runs a method when an event or semaphore is signaled. A timeout value can also be specified, causing the delegate to run after the time span has elapsed if the named event does not occur (or if the semaphore does not reach a signaled state).

Note

The ThreadPool API is supported for desktop as well as UWP apps.

public : sealed class SignalNotifier : ISignalNotifier
struct winrt::Windows::System::Threading::Core::SignalNotifier : ISignalNotifier
public sealed class SignalNotifier : ISignalNotifier
Public NotInheritable Class SignalNotifier Implements ISignalNotifier
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

AttachToEvent(String, SignalHandler) AttachToEvent(String, SignalHandler) AttachToEvent(String, SignalHandler) AttachToEvent(String, SignalHandler)

Attaches a SignalHandler delegate to an event. The delegated method will run the next time the event occurs.

AttachToEvent(String, SignalHandler, TimeSpan) AttachToEvent(String, SignalHandler, TimeSpan) AttachToEvent(String, SignalHandler, TimeSpan) AttachToEvent(String, SignalHandler, TimeSpan)

Attaches a SignalHandler delegate to an event. The delegated method will run if the event occurs or the time span elapses, whichever comes first.

AttachToSemaphore(String, SignalHandler) AttachToSemaphore(String, SignalHandler) AttachToSemaphore(String, SignalHandler) AttachToSemaphore(String, SignalHandler)

Attaches a SignalHandler delegate to a named semaphore. The delegated method will run when the named semaphore is signaled.

AttachToSemaphore(String, SignalHandler, TimeSpan) AttachToSemaphore(String, SignalHandler, TimeSpan) AttachToSemaphore(String, SignalHandler, TimeSpan) AttachToSemaphore(String, SignalHandler, TimeSpan)

Attaches a SignalHandler delegate to a named semaphore and specifies a timeout value. The delegated method will run when the named semaphore is signaled, or if the time span elapses before the semaphore reaches a signaled state.

Enable() Enable() Enable() Enable()

Submits the SignalNotifier to the thread pool.

Terminate() Terminate() Terminate() Terminate()

Terminates the SignalNotifier if it has not already started running.