Is there a generic Task.WaitAll?

A generic method of Task.WaitAll would imply that all Tasks would have to return the same type which would be extremely limited usefulness. Writting something like that could be done manually (see Bas Brekelmans answer), but this wont allow ContinueWith or cancellation without alot of work.

A simple solution if you aren’t using the array for anything else is

  .ToArray<Task>();

Leave a Comment