Async methods should not unnecessarily block threads (UI thread or otherwise). This method delegates to a synchronous Reduce method which calls Task.WaitAll.
It appears Task.WaitAll takes a CancellationToken whereas Task.WhenAll does not offer that option. I see Roslyn is passing in a CancellationToken so that may be why WaitAll was chosen. However there are better ways to combine cancellation and async code.
I'll prepare a pull request for this fix.
Ported from https://roslyn.codeplex.com/workitem/471
Async methods should not unnecessarily block threads (UI thread or otherwise). This method delegates to a synchronous Reduce method which calls Task.WaitAll.
It appears Task.WaitAll takes a CancellationToken whereas Task.WhenAll does not offer that option. I see Roslyn is passing in a CancellationToken so that may be why WaitAll was chosen. However there are better ways to combine cancellation and async code.
I'll prepare a pull request for this fix.
Ported from https://roslyn.codeplex.com/workitem/471