Imported Upstream version 5.10.0.47

Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-24 17:04:36 +00:00
parent 88ff76fe28
commit e46a49ecf1
5927 changed files with 226314 additions and 129848 deletions

View File

@@ -30,10 +30,10 @@ Global
{275B161B-D525-48A0-B1DE-344273AB9A99}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{275B161B-D525-48A0-B1DE-344273AB9A99}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{275B161B-D525-48A0-B1DE-344273AB9A99}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
{DE90AD0B-649D-4062-B8D9-9658DE140532}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{DE90AD0B-649D-4062-B8D9-9658DE140532}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{DE90AD0B-649D-4062-B8D9-9658DE140532}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{DE90AD0B-649D-4062-B8D9-9658DE140532}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
{DE90AD0B-649D-4062-B8D9-9658DE140532}.Debug|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{DE90AD0B-649D-4062-B8D9-9658DE140532}.Debug|Any CPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{DE90AD0B-649D-4062-B8D9-9658DE140532}.Release|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{DE90AD0B-649D-4062-B8D9-9658DE140532}.Release|Any CPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{0DF7FA9A-E7D3-4CEF-862B-A37F5BBBB54C}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{0DF7FA9A-E7D3-4CEF-862B-A37F5BBBB54C}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{0DF7FA9A-E7D3-4CEF-862B-A37F5BBBB54C}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU

View File

@@ -9,7 +9,15 @@
<ProjectReference Include="..\src\System.Threading.Tasks.Extensions.csproj">
<SupportedFramework>net45;netcore45;netcoreapp1.0;wpa81;wp8;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<InboxOnTargetFramework Include="netcoreapp2.0" />
<!-- Since UAP and .NETCoreApp are package based we still want to enable
OOBing libraries that happen to overlap with their framework package.
This avoids us having to lock the API in our NuGet packages just
to match what shipped inbox: since we can provide a new library
we can update it to add API without raising the netstandard version. -->
<ValidatePackageSuppression Include="TreatAsOutOfBox">
<Value>.NETCoreApp;UAP</Value>
</ValidatePackageSuppression>
<!-- this package is part of the implementation closure of NETStandard.Library
therefore it cannot reference NETStandard.Library -->

View File

@@ -3,6 +3,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<ProjectGuid>{0DF7FA9A-E7D3-4CEF-862B-A37F5BBBB54C}</ProjectGuid>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'netcoreapp' Or '$(TargetGroup)' == 'uap'">true</IsPartialFacadeAssembly>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
@@ -25,4 +26,4 @@
<Reference Include="System.Threading.Tasks" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>

View File

@@ -7,7 +7,8 @@
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netcoreapp;
netcoreapp-Windows_NT;
netcoreapp-Unix;
uap-Windows_NT;
</BuildConfigurations>
</PropertyGroup>

View File

@@ -5,24 +5,29 @@
<ProjectGuid>{DE90AD0B-649D-4062-B8D9-9658DE140532}</ProjectGuid>
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
<PackageTargetFramework Condition="'$(TargetGroup)' == 'netstandard1.0'">netstandard1.0;portable-net45+win8+wp8+wpa81</PackageTargetFramework>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' != 'netstandard' and '$(TargetGroup)' != 'netstandard1.0'">true</IsPartialFacadeAssembly>
<ExcludeResourcesImport Condition="'$(IsPartialFacadeAssembly)'=='true'">true</ExcludeResourcesImport>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.0-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.0-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' == 'true'">
<ReferenceFromRuntime Include="System.Private.CoreLib" />
</ItemGroup>
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
<Compile Include="System\Runtime\CompilerServices\AsyncMethodBuilderAttribute.cs" />
<Compile Include="System\Runtime\CompilerServices\AsyncValueTaskMethodBuilder.cs" />
<Compile Include="System\Runtime\CompilerServices\ConfiguredValueTaskAwaitable.cs" />
<Compile Include="System\Runtime\CompilerServices\ValueTaskAwaiter.cs" />
<Compile Include="System\Threading\Tasks\ValueTask.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Runtime" />

View File

@@ -3,7 +3,9 @@
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
#if !MONO
using System.ComponentModel;
#endif
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -157,7 +159,9 @@ namespace System.Threading.Tasks
/// <summary>Creates a method builder for use with an async method.</summary>
/// <returns>The created builder.</returns>
#if !MONO
[EditorBrowsable(EditorBrowsableState.Never)] // intended only for compiler consumption
#endif
public static AsyncValueTaskMethodBuilder<TResult> CreateAsyncMethodBuilder() => AsyncValueTaskMethodBuilder<TResult>.Create();
}
}

View File

@@ -82,36 +82,6 @@ namespace System.Threading.Tasks.Tests
Assert.Equal(1, invokes);
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public async Task AwaitOnCompleted_InvokesStateMachineMethods(bool awaitUnsafe)
{
AsyncValueTaskMethodBuilder<int> b = ValueTask<int>.CreateAsyncMethodBuilder();
var ignored = b.Task;
var callbackCompleted = new TaskCompletionSource<bool>();
IAsyncStateMachine foundSm = null;
var dsm = new DelegateStateMachine
{
MoveNextDelegate = () => callbackCompleted.SetResult(true),
SetStateMachineDelegate = sm => foundSm = sm
};
TaskAwaiter t = Task.CompletedTask.GetAwaiter();
if (awaitUnsafe)
{
b.AwaitUnsafeOnCompleted(ref t, ref dsm);
}
else
{
b.AwaitOnCompleted(ref t, ref dsm);
}
await callbackCompleted.Task;
Assert.Equal(dsm, foundSm);
}
[Theory]
[InlineData(1, false)]
[InlineData(2, false)]
@@ -149,7 +119,6 @@ namespace System.Threading.Tasks.Tests
{
AsyncValueTaskMethodBuilder<int> b = ValueTask<int>.CreateAsyncMethodBuilder();
AssertExtensions.Throws<ArgumentNullException>("stateMachine", () => b.SetStateMachine(null));
b.SetStateMachine(new DelegateStateMachine());
}
[Fact]
@@ -214,8 +183,7 @@ namespace System.Threading.Tasks.Tests
internal Action MoveNextDelegate;
public void MoveNext() => MoveNextDelegate?.Invoke();
internal Action<IAsyncStateMachine> SetStateMachineDelegate;
public void SetStateMachine(IAsyncStateMachine stateMachine) => SetStateMachineDelegate?.Invoke(stateMachine);
public void SetStateMachine(IAsyncStateMachine stateMachine) { }
}
}
}