TaskScheduler.FromCurrentSynchronizationContext 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建与当前SynchronizationContext关联的项TaskScheduler。
public:
static System::Threading::Tasks::TaskScheduler ^ FromCurrentSynchronizationContext();
public static System.Threading.Tasks.TaskScheduler FromCurrentSynchronizationContext();
static member FromCurrentSynchronizationContext : unit -> System.Threading.Tasks.TaskScheduler
Public Shared Function FromCurrentSynchronizationContext () As TaskScheduler
返回
与当前关联的值TaskScheduler,由该集合决定Current。SynchronizationContext
例外
当前 SynchronizationContext 不能用作 TaskScheduler。
注解
排队到返回的计划程序的所有 Task 实例将通过调用 Post 该上下文上的方法来执行。
有关详细信息,请参阅 TaskScheduler。