summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
diff options
context:
space:
mode:
authordnickless <daniel.hegener@gmx.net>2017-01-03 00:02:04 -0500
committerdnickless <daniel.hegener@gmx.net>2017-01-03 00:02:04 -0500
commit81373511a77502b0f10ebe5ad665b870eca198d2 (patch)
treec279f310daaa2c04c8ef9d1e77518d539a73c119 /src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
parent426e4da54f3b79b381f0d5deb11cdc32ffeb4f4d (diff)
downloadcoreclr-81373511a77502b0f10ebe5ad665b870eca198d2.tar.gz
coreclr-81373511a77502b0f10ebe5ad665b870eca198d2.tar.bz2
coreclr-81373511a77502b0f10ebe5ad665b870eca198d2.zip
Performance improvement: Make ConcurrentDictionary with an Enum key 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 c1a6f7564c..9ef1544c18 100644
--- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
+++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
@@ -104,6 +104,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