Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -1,7 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Linq.Parallel.Tests", "tests\System.Linq.Parallel.Tests.csproj", "{A7074928-82C3-4739-88FE-9B528977950C}"
ProjectSection(ProjectDependencies) = postProject
@@ -9,28 +8,43 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Linq.Parallel.Tests"
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Linq.Parallel", "src\System.Linq.Parallel.csproj", "{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{47919FF5-DA40-4D99-AF2D-F560282AA913}"
ProjectSection(SolutionItems) = preProject
..\.nuget\packages.Windows_NT.config = ..\.nuget\packages.Windows_NT.config
ProjectSection(ProjectDependencies) = postProject
{670405FE-3828-436E-A668-A0F0B88B57A4} = {670405FE-3828-436E-A668-A0F0B88B57A4}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Linq.Parallel", "ref\System.Linq.Parallel.csproj", "{670405FE-3828-436E-A668-A0F0B88B57A4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1A2F9F4A-A032-433E-B914-ADD5992BB178}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU
ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A7074928-82C3-4739-88FE-9B528977950C}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{A7074928-82C3-4739-88FE-9B528977950C}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{A7074928-82C3-4739-88FE-9B528977950C}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{A7074928-82C3-4739-88FE-9B528977950C}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{A7074928-82C3-4739-88FE-9B528977950C}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{A7074928-82C3-4739-88FE-9B528977950C}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{A7074928-82C3-4739-88FE-9B528977950C}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{A7074928-82C3-4739-88FE-9B528977950C}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
{670405FE-3828-436E-A668-A0F0B88B57A4}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{670405FE-3828-436E-A668-A0F0B88B57A4}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{670405FE-3828-436E-A668-A0F0B88B57A4}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{670405FE-3828-436E-A668-A0F0B88B57A4}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A7074928-82C3-4739-88FE-9B528977950C} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
{BE28323E-327A-4E0F-B7F9-16AB7EAB59DD} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
{670405FE-3828-436E-A668-A0F0B88B57A4} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
EndGlobalSection
EndGlobal

View File

@@ -4,5 +4,6 @@
<PropertyGroup>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<IsNETCoreApp>true</IsNETCoreApp>
<IsUAP>true</IsUAP>
</PropertyGroup>
</Project>

View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<ProjectGuid>{670405FE-3828-436E-A668-A0F0B88B57A4}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />

View File

@@ -3,6 +3,7 @@
<PropertyGroup>
<BuildConfigurations>
netcoreapp;
uap-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -1,64 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@@ -117,18 +58,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="MoreThanOneElement" xml:space="preserve">
<value>Sequence contains more than one element</value>
</data>
<data name="MoreThanOneMatch" xml:space="preserve">
<value>Sequence contains more than one matching element</value>
</data>
<data name="NoElements" xml:space="preserve">
<value>Sequence contains no elements</value>
</data>
<data name="NoMatch" xml:space="preserve">
<value>Sequence contains no matching element</value>
</data>
<data name="ParallelPartitionable_NullReturn" xml:space="preserve">
<value>The return value must not be null.</value>
</data>

View File

@@ -7,9 +7,11 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Release|AnyCPU'" />
<!-- Compiled Source Files -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="System\Linq\Parallel\Channels\AsynchronousChannel.cs" />
<Compile Include="System\Linq\Parallel\Channels\SynchronousChannel.cs" />
@@ -164,4 +166,4 @@
<Reference Include="System.Threading.Tasks" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>

View File

@@ -13,6 +13,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq.Parallel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Linq
{
@@ -46,6 +47,7 @@ namespace System.Linq
// is thrown.
//
[ExcludeFromCodeCoverage]
internal virtual ParallelQuery<TCastTo> Cast<TCastTo>()
{
Debug.Fail("The derived class must override this method.");
@@ -58,6 +60,7 @@ namespace System.Linq
// the results.
//
[ExcludeFromCodeCoverage]
internal virtual ParallelQuery<TCastTo> OfType<TCastTo>()
{
Debug.Fail("The derived class must override this method.");
@@ -70,6 +73,7 @@ namespace System.Linq
// IEnumerable<T>.
//
[ExcludeFromCodeCoverage]
internal virtual IEnumerator GetEnumeratorUntyped()
{
Debug.Fail("The derived class must override this method.");

View File

@@ -50,7 +50,7 @@ namespace System.Linq.Parallel
{
int partitionSize = (i < biggerPartitionCount) ? stride + 1 : stride;
partitions[i] = new RangeEnumerator(
_from + doneCount,
unchecked(_from + doneCount),
partitionSize,
doneCount);
doneCount += partitionSize;

View File

@@ -15,6 +15,7 @@ using System.Text;
using System.Linq.Parallel;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Diagnostics.CodeAnalysis;
namespace System.Linq.Parallel
{
@@ -70,6 +71,7 @@ namespace System.Linq.Parallel
/// We never expect this method to be called. ArrayMergeHelper is intended to be used when we want
/// to consume the results using GetResultsAsArray().
/// </summary>
[ExcludeFromCodeCoverage]
public IEnumerator<TInputOutput> GetEnumerator()
{
Debug.Fail("ArrayMergeHelper<>.GetEnumerator() is not intended to be used. Call GetResultsAsArray() instead.");

View File

@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
@@ -166,6 +167,7 @@ namespace System.Linq.Parallel
// Returns the results as an array.
//
[ExcludeFromCodeCoverage]
public TOutput[] GetResultsAsArray()
{
Debug.Fail("An ordered pipelining merge is not intended to be used this way.");

View File

@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
namespace System.Linq.Parallel
@@ -212,6 +213,7 @@ namespace System.Linq.Parallel
// Returns an enumerable that represents the query executing sequentially.
//
[ExcludeFromCodeCoverage]
internal override IEnumerable<TIntermediate> AsSequentialQuery(CancellationToken token)
{
Debug.Fail("This method should never be called. Associative aggregation can always be parallelized.");

View File

@@ -228,7 +228,6 @@ namespace System.Linq.Parallel
class ConcatQueryOperatorResults : BinaryQueryOperatorResults
{
private ConcatQueryOperator<TSource> _concatOp; // Operator that generated the results
private int _leftChildCount; // The number of elements in the left child result set
private int _rightChildCount; // The number of elements in the right child result set
@@ -255,7 +254,6 @@ namespace System.Linq.Parallel
bool preferStriping)
: base(leftChildQueryResults, rightChildQueryResults, concatOp, settings, preferStriping)
{
_concatOp = concatOp;
Debug.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible);
_leftChildCount = leftChildQueryResults.ElementsCount;

View File

@@ -145,7 +145,7 @@ namespace System.Linq.Parallel
for (int i = 0; i < partitionCount; i++)
{
outputStream[i] = new UnionQueryOperatorEnumerator<TLeftKey, TRightKey>(
leftHashStream[i], rightHashStream[i], i, _comparer, cancellationToken);
leftHashStream[i], rightHashStream[i], _comparer, cancellationToken);
}
outputRecipient.Receive(outputStream);
@@ -184,7 +184,6 @@ namespace System.Linq.Parallel
{
private QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> _leftSource; // Left data source.
private QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TRightKey> _rightSource; // Right data source.
private readonly int _partitionIndex; // The current partition.
private Set<TInputOutput> _hashLookup; // The hash lookup, used to produce the union.
private CancellationToken _cancellationToken;
private Shared<int> _outputLoopCount;
@@ -197,7 +196,7 @@ namespace System.Linq.Parallel
internal UnionQueryOperatorEnumerator(
QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> leftSource,
QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TRightKey> rightSource,
int partitionIndex, IEqualityComparer<TInputOutput> comparer,
IEqualityComparer<TInputOutput> comparer,
CancellationToken cancellationToken)
{
Debug.Assert(leftSource != null);
@@ -205,7 +204,6 @@ namespace System.Linq.Parallel
_leftSource = leftSource;
_rightSource = rightSource;
_partitionIndex = partitionIndex;
_comparer = comparer;
_cancellationToken = cancellationToken;
}

View File

@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
namespace System.Linq.Parallel
@@ -142,6 +143,7 @@ namespace System.Linq.Parallel
protected abstract QueryOperatorEnumerator<TIntermediate, int> CreateEnumerator<TKey>(
int index, int count, QueryOperatorEnumerator<TSource, TKey> source, object sharedData, CancellationToken cancellationToken);
[ExcludeFromCodeCoverage]
internal override IEnumerable<TIntermediate> AsSequentialQuery(CancellationToken token)
{
Debug.Fail("This method should never be called. Associative aggregation can always be parallelized.");

View File

@@ -20,8 +20,6 @@ namespace System.Linq.Parallel
/// <typeparam name="TSource"></typeparam>
internal sealed class OrderingQueryOperator<TSource> : QueryOperator<TSource>
{
// Turns on order (AsOrdered) or turns off order (AsUnordered)
private bool _orderOn;
private QueryOperator<TSource> _child;
private OrdinalIndexState _ordinalIndexState;
@@ -30,7 +28,6 @@ namespace System.Linq.Parallel
{
_child = child;
_ordinalIndexState = _child.OrdinalIndexState;
_orderOn = orderOn;
}
internal override QueryResults<TSource> Open(QuerySettings settings, bool preferStriping)

View File

@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
namespace System.Linq.Parallel
@@ -123,6 +124,7 @@ namespace System.Linq.Parallel
// Returns an enumerable that represents the query executing sequentially.
//
[ExcludeFromCodeCoverage]
internal override IEnumerable<bool> AsSequentialQuery(CancellationToken token)
{
Debug.Fail("This method should never be called as it is an ending operator with LimitsParallelism=false.");

View File

@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
namespace System.Linq.Parallel
@@ -109,6 +110,7 @@ namespace System.Linq.Parallel
// Returns an enumerable that represents the query executing sequentially.
//
[ExcludeFromCodeCoverage]
internal override IEnumerable<bool> AsSequentialQuery(CancellationToken token)
{
Debug.Fail("This method should never be called as it is an ending operator with LimitsParallelism=false.");

View File

@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
namespace System.Linq.Parallel
@@ -97,6 +98,7 @@ namespace System.Linq.Parallel
// Returns an enumerable that represents the query executing sequentially.
//
[ExcludeFromCodeCoverage]
internal override IEnumerable<TSource> AsSequentialQuery(CancellationToken token)
{
Debug.Fail("This method should never be called as fallback to sequential is handled in Aggregate().");

View File

@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
namespace System.Linq.Parallel
@@ -95,6 +96,7 @@ namespace System.Linq.Parallel
// Returns an enumerable that represents the query executing sequentially.
//
[ExcludeFromCodeCoverage]
internal override IEnumerable<TSource> AsSequentialQuery(CancellationToken token)
{
Debug.Fail("This method should never be called as fallback to sequential is handled in ParallelEnumerable.First().");

View File

@@ -11,6 +11,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Linq.Parallel
{
@@ -99,6 +100,7 @@ namespace System.Linq.Parallel
// Returns an enumerable that represents the query executing sequentially.
//
[ExcludeFromCodeCoverage]
internal override IEnumerable<TInput> AsSequentialQuery(CancellationToken token)
{
Debug.Fail("AsSequentialQuery is not supported on ForAllOperator");

Some files were not shown because too many files have changed in this diff Show More