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.
Zero/ZeroLevel/Services/Async/Internal/CanceledValueTask.cs

17 lines
384 B

using System.Threading.Tasks;
namespace ZeroLevel.Services.Async.Internal
{
internal static class CanceledValueTask<T>
{
public static readonly ValueTask<T> Value = CreateCanceledTask();
private static ValueTask<T> CreateCanceledTask()
{
TaskCompletionSource<T> tcs = new TaskCompletionSource<T>();
tcs.SetCanceled();
return new ValueTask<T>(tcs.Task);
}
}
}

Powered by TurnKey Linux.