Pārlūkot izejas kodu

[System.Core] Bring .NET implementation of ReaderWriterLockSlim.

Marcos Henrich 11 gadi atpakaļ
vecāks
revīzija
4e735b6e30

+ 11 - 0
mcs/class/System.Core/ReferenceSources/SR.cs

@@ -52,4 +52,15 @@ partial class SR
 	public const string PartitionerQueryOperator_NullPartition = "PartitionerQueryOperator_NullPartition";
 	public const string PartitionerQueryOperator_NullPartitionList = "PartitionerQueryOperator_NullPartitionList";
 	public const string PartitionerQueryOperator_WrongNumberOfPartitions = "PartitionerQueryOperator_WrongNumberOfPartitions";
+	public const string LockRecursionException_ReadAfterWriteNotAllowed = "LockRecursionException_ReadAfterWriteNotAllowed";
+	public const string LockRecursionException_RecursiveReadNotAllowed = "LockRecursionException_RecursiveReadNotAllowed";
+	public const string LockRecursionException_RecursiveUpgradeNotAllowed = "LockRecursionException_RecursiveUpgradeNotAllowed";
+	public const string LockRecursionException_RecursiveWriteNotAllowed = "LockRecursionException_RecursiveWriteNotAllowed";
+	public const string LockRecursionException_UpgradeAfterReadNotAllowed = "LockRecursionException_UpgradeAfterReadNotAllowed";
+	public const string LockRecursionException_UpgradeAfterWriteNotAllowed = "LockRecursionException_UpgradeAfterWriteNotAllowed";
+	public const string LockRecursionException_WriteAfterReadNotAllowed = "LockRecursionException_WriteAfterReadNotAllowed";
+	public const string SynchronizationLockException_IncorrectDispose = "SynchronizationLockException_IncorrectDispose";
+	public const string SynchronizationLockException_MisMatchedRead = "SynchronizationLockException_MisMatchedRead";
+	public const string SynchronizationLockException_MisMatchedUpgrade = "SynchronizationLockException_MisMatchedUpgrade";
+	public const string SynchronizationLockException_MisMatchedWrite = "SynchronizationLockException_MisMatchedWrite";
 }

+ 6 - 3
mcs/class/System.Core/System.Core-net_4_5.csproj

@@ -284,8 +284,6 @@
     <Compile Include="System.Security.Cryptography\SHA512CryptoServiceProvider.cs" />
     <Compile Include="System.Threading.Tasks\TaskExtensions.cs" />
     <Compile Include="System.Threading\LockRecursionException.cs" />
-    <Compile Include="System.Threading\LockRecursionPolicy.cs" />
-    <Compile Include="System.Threading\ReaderWriterLockSlim.cs" />
     <Compile Include="System.Threading\ReaderWriterLockSlimExtensions.cs" />
     <Compile Include="System.Threading\ThreadLockState.cs" />
     <Compile Include="System\Actions.cs" />
@@ -295,7 +293,12 @@
     <Compile Include="System\TimeZoneInfo.cs" />
     <Compile Include="System\TimeZoneInfo.TransitionTime.cs" />
     <Compile Include="System\TimeZoneNotFoundException.cs" />
-    <Compile Include="System\Util.cs" />
  </ItemGroup>
+    <Compile Include="System\Util.cs" />
+    <Compile Include="ReferenceSources/Set.cs" />
+    <Compile Include="ReferenceSources/SR.cs" />
+    <Compile Include="..\..\build\common\SR.cs" />
+    <Compile Include="..\..\..\external\referencesource\System.Core\System\threading\ReaderWriterLockSlim\ReaderWriterLockSlim.cs" />
+  </ItemGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 6 - 3
mcs/class/System.Core/System.Core-plaincore-net_4_5.csproj

@@ -284,8 +284,6 @@
     <Compile Include="System.Security.Cryptography\SHA512CryptoServiceProvider.cs" />
     <Compile Include="System.Threading.Tasks\TaskExtensions.cs" />
     <Compile Include="System.Threading\LockRecursionException.cs" />
-    <Compile Include="System.Threading\LockRecursionPolicy.cs" />
-    <Compile Include="System.Threading\ReaderWriterLockSlim.cs" />
     <Compile Include="System.Threading\ReaderWriterLockSlimExtensions.cs" />
     <Compile Include="System.Threading\ThreadLockState.cs" />
     <Compile Include="System\Actions.cs" />
@@ -295,7 +293,12 @@
     <Compile Include="System\TimeZoneInfo.cs" />
     <Compile Include="System\TimeZoneInfo.TransitionTime.cs" />
     <Compile Include="System\TimeZoneNotFoundException.cs" />
-    <Compile Include="System\Util.cs" />
  </ItemGroup>
+    <Compile Include="System\Util.cs" />
+    <Compile Include="ReferenceSources/Set.cs" />
+    <Compile Include="ReferenceSources/SR.cs" />
+    <Compile Include="..\..\build\common\SR.cs" />
+    <Compile Include="..\..\..\external\referencesource\System.Core\System\threading\ReaderWriterLockSlim\ReaderWriterLockSlim.cs" />
+  </ItemGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 4 - 2
mcs/class/System.Core/System.Core.dll.sources

@@ -1,5 +1,8 @@
+../../build/common/SR.cs
 ../../build/common/Consts.cs
 Assembly/AssemblyInfo.cs
+ReferenceSources/SR.cs
+ReferenceSources/Set.cs
 System/Actions.cs
 System/Funcs.cs
 System/InvalidTimeZoneException.cs
@@ -78,8 +81,6 @@ System.Security.Cryptography/SHA384CryptoServiceProvider.cs
 System.Security.Cryptography/SHA512Cng.cs
 System.Security.Cryptography/SHA512CryptoServiceProvider.cs
 System.Threading/LockRecursionException.cs
-System.Threading/LockRecursionPolicy.cs
-System.Threading/ReaderWriterLockSlim.cs
 System.Threading/ThreadLockState.cs
 System.Threading/ReaderWriterLockSlimExtensions.cs
 Microsoft.Win32.SafeHandles/SafePipeHandle.cs
@@ -100,3 +101,4 @@ System.IO.Pipes/PipeTransmissionMode.cs
 System.IO.Pipes/PipeUnix.cs
 System.IO.Pipes/PipeWin32.cs
 System.IO/HandleInheritability.cs
+../../../external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/ReaderWriterLockSlim.cs

+ 4 - 2
mcs/class/System.Core/mobile_common_System.Core.dll.sources

@@ -36,8 +36,6 @@ System.Linq/SortSequenceContext.cs
 System.Linq/IQueryProvider.cs
 System.Collections.Generic/HashSet.cs
 System.Security.Cryptography/Aes.cs
-System.Threading/LockRecursionPolicy.cs
-System.Threading/ReaderWriterLockSlim.cs
 System.Threading/ThreadLockState.cs
 System.Threading/ReaderWriterLockSlimExtensions.cs
 System.Linq/EnumerableExecutor.cs
@@ -57,6 +55,10 @@ System.IO/HandleInheritability.cs
 System.Threading.Tasks/TaskExtensions.cs
 System.Linq.Expressions/Extensions.cs
 System.Linq.Expressions/ExpressionTransformer.cs
+ReferenceSources/SR.cs
+ReferenceSources/Set.cs
+../../build/common/SR.cs
+../../../external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/ReaderWriterLockSlim.cs
 ../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs
 ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs
 System.Linq.Expressions/DynamicExpressionVisitor.cs

+ 1 - 2
mcs/class/System.Core/net_4_0_System.Core.dll.sources

@@ -61,8 +61,6 @@ System.Security.Cryptography/SHA384CryptoServiceProvider.cs
 System.Security.Cryptography/SHA512Cng.cs
 System.Security.Cryptography/SHA512CryptoServiceProvider.cs
 System.Threading/LockRecursionException.cs
-System.Threading/LockRecursionPolicy.cs
-System.Threading/ReaderWriterLockSlim.cs
 System.Threading/ThreadLockState.cs
 System.Threading/ReaderWriterLockSlimExtensions.cs
 System.Threading.Tasks/TaskExtensions.cs
@@ -227,6 +225,7 @@ System.IO/HandleInheritability.cs
 ../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs
 ../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs
 ../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs
+../../../external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/ReaderWriterLockSlim.cs
 
 ReferenceSources/Set.cs
 ReferenceSources/SR.cs