You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
796 B
26 lines
796 B
5 years ago
|
#if NET20 || NET30 || NET35 || !NET_4_6
|
||
|
|
||
|
using System.Runtime.CompilerServices;
|
||
|
|
||
|
namespace System.Threading.Tasks
|
||
|
{
|
||
|
public partial class Task
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Creates an awaitable that asynchronously yields back to the current context when awaited.
|
||
|
/// </summary>
|
||
|
///
|
||
|
/// <returns>
|
||
|
/// A context that, when awaited, will asynchronously transition back into the current context.
|
||
|
/// If SynchronizationContext.Current is non-null, that is treated as the current context.
|
||
|
/// Otherwise, TaskScheduler.Current is treated as the current context.
|
||
|
///
|
||
|
/// </returns>
|
||
|
public static YieldAwaitable Yield()
|
||
|
{
|
||
|
return new YieldAwaitable();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|