Skip to content

Commit d5b780a

Browse files
authored
Merge pull request #163 from stukselbax/master
Make shared cache for types resolution thread safe
2 parents 6aac80b + db0ad29 commit d5b780a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs

+2-1
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)