Skip to content

Commit

Permalink
Replaced Dictionary with ConcurrentDictionary in HierarchicalLifetime…
Browse files Browse the repository at this point in the history
…Manager
  • Loading branch information
ENikS committed Dec 30, 2017
1 parent 6f26e9d commit d69ba1d
Show file tree
Hide file tree
Showing 3 changed files with 1,953 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Lifetime/HierarchicalLifetimeManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.

using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;

Expand All @@ -16,7 +15,8 @@ public class HierarchicalLifetimeManager : SynchronizedLifetimeManager,
{
#region Fields

private readonly IDictionary<ILifetimeContainer, object> _values = new Dictionary<ILifetimeContainer, object>();
private readonly IDictionary<ILifetimeContainer, object> _values =
new ConcurrentDictionary<ILifetimeContainer, object>();

#endregion

Expand Down
4 changes: 4 additions & 0 deletions src/Unity.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<RootNamespace>Unity</RootNamespace>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netstandard1.0' ">
<Compile Remove="Utility\ConcurrentDictionary.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != '' AND $(TargetFramework.StartsWith('netcoreapp'))">
<Compile Remove="Exceptions\ResolutionFailedException.Desktop.cs" />
<Compile Remove="Exceptions\IllegalInjectionMethodException.Desktop.cs" />
Expand Down
Loading

0 comments on commit d69ba1d

Please sign in to comment.