Skip to content

Commit db0ad29

Browse files
committed
Make shared cache for types resolution thread safe
1 parent 6aac80b commit db0ad29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
using System;
1111
using System.Collections;
12+
using System.Collections.Concurrent;
1213
using System.Collections.Generic;
1314
using System.ComponentModel;
1415
using System.Dynamic;
@@ -474,7 +475,7 @@ protected enum TryBlockEvaluatedState
474475
/// <summary>
475476
/// A shared cache for types resolution.
476477
/// </summary>
477-
public static IDictionary<string, Type> TypesResolutionCaching { get; set; } = new Dictionary<string, Type>();
478+
public static IDictionary<string, Type> TypesResolutionCaching { get; set; } = new ConcurrentDictionary<string, Type>();
478479

479480
/// <summary>
480481
/// Clear all ExpressionEvaluator caches

0 commit comments

Comments
 (0)