diff options
author | Maxim Lipnin <mlipnin@gmail.com> | 2018-04-16 21:58:10 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-04-19 02:34:19 +0300 |
commit | 0ee9a8af686642e73a4a57c6bb32b0ad439ba37e (patch) | |
tree | 9a6159b637acd56792a79918ba65dbb8a9e92b47 /src/System.Private.Xml.Linq | |
parent | 3c0a9a4ab6853a390b674dc246421fd68c35f549 (diff) |
[System.Private.Xml.Linq] Remove SILVERLIGHT define (#29025)
Diffstat (limited to 'src/System.Private.Xml.Linq')
-rw-r--r-- | src/System.Private.Xml.Linq/src/System.Private.Xml.Linq.csproj | 2 | ||||
-rw-r--r-- | src/System.Private.Xml.Linq/src/System/Xml/Linq/XHashtable.cs | 18 |
2 files changed, 2 insertions, 18 deletions
diff --git a/src/System.Private.Xml.Linq/src/System.Private.Xml.Linq.csproj b/src/System.Private.Xml.Linq/src/System.Private.Xml.Linq.csproj index 1d5ade2524..0f9c0a1495 100644 --- a/src/System.Private.Xml.Linq/src/System.Private.Xml.Linq.csproj +++ b/src/System.Private.Xml.Linq/src/System.Private.Xml.Linq.csproj @@ -5,7 +5,6 @@ <ProjectGuid>{BAC347A3-9841-44FC-B1E3-2344D1152C23}</ProjectGuid> <AssemblyName>System.Private.Xml.Linq</AssemblyName> <RootNamespace>System.Xml</RootNamespace> - <DefineConstants>$(DefineConstants);SILVERLIGHT</DefineConstants> <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" /> @@ -71,6 +70,7 @@ <Reference Include="System.Runtime.Extensions" /> <Reference Include="System.Threading" /> <Reference Include="System.Threading.Tasks" /> + <Reference Include="System.Threading.Thread" /> </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> </Project>
\ No newline at end of file diff --git a/src/System.Private.Xml.Linq/src/System/Xml/Linq/XHashtable.cs b/src/System.Private.Xml.Linq/src/System/Xml/Linq/XHashtable.cs index ae13f99791..caeeac837c 100644 --- a/src/System.Private.Xml.Linq/src/System/Xml/Linq/XHashtable.cs +++ b/src/System.Private.Xml.Linq/src/System/Xml/Linq/XHashtable.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Threading; using Debug = System.Diagnostics.Debug; using Interlocked = System.Threading.Interlocked; @@ -109,17 +110,8 @@ namespace System.Xml.Linq lock (this) { XHashtableState newState = _state.Resize(); - // Use memory barrier to ensure that the resized XHashtableState object is fully constructed before it is assigned -#if !SILVERLIGHT Thread.MemoryBarrier(); -#else // SILVERLIGHT - // The MemoryBarrier method usage is probably incorrect and should be removed. - - // Replacing with Interlocked.CompareExchange for now (with no effect) - // which will do a very similar thing to MemoryBarrier (it's just slower) - System.Threading.Interlocked.CompareExchange<XHashtableState>(ref _state, null, null); -#endif // SILVERLIGHT _state = newState; } } @@ -302,15 +294,7 @@ namespace System.Xml.Linq // Ensure that all writes to the entry can't be reordered past this barrier (or other threads might see new entry // in list before entry has been initialized!). -#if !SILVERLIGHT Thread.MemoryBarrier(); -#else // SILVERLIGHT - // The MemoryBarrier method usage is probably incorrect and should be removed. - - // Replacing with Interlocked.CompareExchange for now (with no effect) - // which will do a very similar thing to MemoryBarrier (it's just slower) - System.Threading.Interlocked.CompareExchange<Entry[]>(ref _entries, null, null); -#endif // SILVERLIGHT // Loop until a matching entry is found, a new entry is added, or linked list is found to be full entryIndex = 0; |