summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
diff options
context:
space:
mode:
authorDan Moseley <danmose@microsoft.com>2017-02-16 18:47:45 -0800
committerGitHub <noreply@github.com>2017-02-16 18:47:45 -0800
commitd4ad328f62a9ab493d6026e77d2c79f1ab039688 (patch)
tree9c2e37ee40897cb19523a36787e42d93cb18b622 /src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
parent9344c8e9c62126e045ce84696c0eac81b2f5c56b (diff)
parent909adfa9b7df8e989f2137e6db2a5691d1149e5c (diff)
downloadcoreclr-d4ad328f62a9ab493d6026e77d2c79f1ab039688.tar.gz
coreclr-d4ad328f62a9ab493d6026e77d2c79f1ab039688.tar.bz2
coreclr-d4ad328f62a9ab493d6026e77d2c79f1ab039688.zip
Merge pull request #8778 from dnickless/master
Performance improvement: Make ConcurrentDictionary with Enum values also profit from atomic writes.
Diffstat (limited to 'src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs')
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
index 8b9014a103..a0030e153e 100644
--- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
+++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
@@ -102,6 +102,10 @@ namespace System.Collections.Concurrent
private static bool IsValueWriteAtomic()
{
Type valueType = typeof(TValue);
+ if (valueType.IsEnum)
+ {
+ valueType = Enum.GetUnderlyingType(valueType);
+ }
//
// Section 12.6.6 of ECMA CLI explains which types can be read and written atomically without