Skip to content

Commit

Permalink
Resolved #635 - Use the ConcurrentDictionary for constructor invoker …
Browse files Browse the repository at this point in the history
…caching in DNX451 and DNXCORE50.
  • Loading branch information
alexmg committed Apr 14, 2015
1 parent c7e1bb8 commit 3c6309a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -24,6 +24,9 @@
// OTHER DEALINGS IN THE SOFTWARE.

using System;
#if DNX451 || DNXCORE50
using System.Collections.Concurrent;
#endif
using System.Collections.Generic;
using System.Globalization;
using System.Linq.Expressions;
Expand All @@ -39,7 +42,11 @@ public class ConstructorParameterBinding
{
readonly ConstructorInfo _ci;
readonly Func<object>[] _valueRetrievers;
#if DNX451 || DNXCORE50
readonly static ConcurrentDictionary<ConstructorInfo, Func<object[], object>> _constructorInvokers = new ConcurrentDictionary<ConstructorInfo, Func<object[], object>>();
#else
readonly static SafeDictionary<ConstructorInfo, Func<object[], object>> _constructorInvokers = new SafeDictionary<ConstructorInfo, Func<object[], object>>();
#endif

// We really need to report all non-bindable parameters, howevers some refactoring
// will be necessary before this is possible. Adding this now to ease the
Expand Down
3 changes: 2 additions & 1 deletion src/Autofac/project.json
Expand Up @@ -19,7 +19,8 @@
"dnx451": { },
"dnxcore50": {
"dependencies": {
"System.Collections": "4.0.10-beta-*",
"System.Collections": "4.0.10-beta-*",
"System.Collections.Concurrent": "4.0.10-beta-*",
"System.ComponentModel": "4.0.0-beta-*",
"System.Diagnostics.Contracts": "4.0.0-beta-*",
"System.Diagnostics.Debug": "4.0.10-beta-*",
Expand Down

0 comments on commit 3c6309a

Please sign in to comment.