Upravit

Sdílet prostřednictvím


winrt::resume_on_signal function (C++/WinRT)

A function that you can use to suspend until a kernel event is signaled.

For more info, and code examples, see Awaiting a kernel handle.

Syntax

auto resume_on_signal(
    void* handle,
    winrt::Windows::Foundation::TimeSpan timeout = {}) noexcept

Parameters

handle A handle to the kernel event to wait on. You're responsible for ensuring that this handle remains valid until your co_await of the function completes.

timeout An optional timeout value. If you pass a timeout of 0, that's treated as infinite. Behavior is undefined if you pass a negative timeout.

Return value

An awaitable object (an object that can be passed to co_await). The result of the co_await is true if the handle is signaled, or false if the timeout elapsed.

Requirements

Minimum supported SDK: Windows SDK version 10.0.17134.0 (Windows 10, version 1803)

Namespace: winrt

Header: %WindowsSdkDir%Include<WindowsTargetPlatformVersion>\cppwinrt\winrt\base.h (included by default)

See also