Created
November 27, 2010 04:29
-
-
Save ahjohannessen/717568 to your computer and use it in GitHub Desktop.
Fixes threading issue.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public CompoundInterceptor FindInterceptor(Type type) | |
{ | |
CompoundInterceptor interceptor; | |
if (!_analyzedInterceptors.TryGetValue(type, out interceptor)) | |
{ | |
lock (_locker) | |
{ | |
if (!_analyzedInterceptors.TryGetValue(type, out interceptor)) | |
{ | |
TypeInterceptor[] interceptorArray = _interceptors.FindAll(i => i.MatchesType(type)).ToArray(); | |
interceptor = new CompoundInterceptor(interceptorArray); | |
_analyzedInterceptors.Add(type, interceptor); | |
} | |
} | |
} | |
return interceptor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment