x) Fix multiple attempts to fill in the type cache

This commit is contained in:
Marc Hernandez 2021-01-16 18:15:31 -08:00 committed by Marc Hernandez
parent add6423b24
commit 1f495bfd0e

View File

@ -148,8 +148,15 @@ static public class refl
public static ImmutableList<FieldInfo> GetAllFields( Type t )
{
if( s_fieldCache.TryGetValue( t, out var info ) )
return info;
{
if( s_fieldCache.TryGetValue( t, out var first ) )
return first;
}
lock( t )
{
if( s_fieldCache.TryGetValue( t, out var second ) )
return second;
var list = new List<FieldInfo>();
@ -161,6 +168,7 @@ static public class refl
return immList;
}
}
public static void GetAllProperties( Type t, List<PropertyInfo> list )