JoinableTaskFactory.MainThreadAwaitable 结构

定义

将异步过渡简化为主线程的可等待结构。

public: value class JoinableTaskFactory::MainThreadAwaitable
struct JoinableTaskFactory::MainThreadAwaitable
public struct JoinableTaskFactory.MainThreadAwaitable
[System.Runtime.CompilerServices.IsReadOnly]
public readonly struct JoinableTaskFactory.MainThreadAwaitable
type JoinableTaskFactory.MainThreadAwaitable = struct
[<System.Runtime.CompilerServices.IsReadOnly>]
type JoinableTaskFactory.MainThreadAwaitable = struct
Public Structure JoinableTaskFactory.MainThreadAwaitable
继承
JoinableTaskFactory.MainThreadAwaitable
属性

方法

GetAwaiter()

获取 awaiter。

NoThrowAwaitable()

返回指定 SwitchToMainThreadAsync(CancellationToken) 操作的可等待值,该操作在请求取消时不会引发异常。

适用于

线程安全性

此类型对所有成员都是线程安全的。