Create a completed Task

.net, async-await, c#, task-parallel-library

Solution

The newest version of .Net (v4.6) is adding just that, a built-in Task.CompletedTask:

Task completedTask = Task.CompletedTask;

That property is implemented as a no-lock singleton so you would almost always be using the same completed task.

Problem

I want to create a completed `Task` (not `Task<T>`). Is there something built into .NET to do this? A related question: Create a completed Task<T>

Original source

Related problems