首页 > 其他 > 详细

Task.ConfigureAwait

时间:2016-06-01 19:44:14      阅读:173      评论:0      收藏:0      [点我收藏+]

 

 

 

public ConfiguredTaskAwaitable ConfigureAwait(
    bool continueOnCapturedContext
)

Configures an awaiter used to await this Task.

Parameters

continueOnCapturedContext
Type: System.Boolean

true to attempt to marshal the continuation back to the original context captured; otherwise, false.

Return Value

Type: System.Runtime.CompilerServices.ConfiguredTaskAwaitable

An object used to await this task.

 

 

 

结构体

ConfiguredTaskAwaitable 

Provides an awaitable object that enables configured awaits on a task.

Remark:

此结构体,是编译器专用的

This type is intended for compiler use; do not use it directly in your code.

 

 

在UI线程当中使用await的时候,需要使用ConfigureAwait(false)

 

Task.ConfigureAwait

原文:http://www.cnblogs.com/chucklu/p/5550690.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!