Add TaskExtensions to CoreLib
authorStephen Toub <stoub@microsoft.com>
Tue, 7 Mar 2017 17:50:17 +0000 (12:50 -0500)
committerStephen Toub <stoub@microsoft.com>
Tue, 7 Mar 2017 19:21:39 +0000 (14:21 -0500)
commit67f94ba67db9482c9f1d3ce0d52b8a9c9f673b98
tree9f6f317937f52ac74fc915d0fcedfda8c50fef06
parent572802426f92aa4444735ae4671e1d6f52f0f33c
Add TaskExtensions to CoreLib

Our TaskExtensions.Unwrap implementation in corefx is more allocation-heavy than the implementation we had in desktop and we could have in CoreLib, where CreateUnwrapPromise is available.  By moving this implementation down to CoreLib, the code:
```C#
Task<Task> toUnwrap = ...;
Task t = toUnwrap.Unwrap();
```
incurs 1 allocation instead of 4.

Commit migrated from https://github.com/dotnet/coreclr/commit/d8f3e8eebee940cb3c52aee3df3298f1a143f304
src/coreclr/src/mscorlib/System.Private.CoreLib.csproj
src/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskExtensions.cs [new file with mode: 0644]