From 7c65d2c741599744088dfb8cc3a69a414b7e0bbe Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Wed, 30 Dec 2020 09:16:25 +0100 Subject: [PATCH] Model: Eliminate no-longer needed thread lock in CAD --- .../Reflection/CustomAttributeData.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Il2CppInspector.Common/Reflection/CustomAttributeData.cs b/Il2CppInspector.Common/Reflection/CustomAttributeData.cs index d3de450..5f6fc99 100644 --- a/Il2CppInspector.Common/Reflection/CustomAttributeData.cs +++ b/Il2CppInspector.Common/Reflection/CustomAttributeData.cs @@ -64,14 +64,8 @@ namespace Il2CppInspector.Reflection } } - private static readonly object gcaLock = new object(); - private static IList getCustomAttributes(Assembly asm, uint token, int customAttributeIndex) { - // Force the generation of the collection to be thread-safe - // Convert the result into a list for thread-safe enumeration - lock (gcaLock) { - return getCustomAttributes(asm, asm.Model.GetCustomAttributeIndex(asm, token, customAttributeIndex)).ToList(); - } - } + private static IList getCustomAttributes(Assembly asm, uint token, int customAttributeIndex) => + getCustomAttributes(asm, asm.Model.GetCustomAttributeIndex(asm, token, customAttributeIndex)).ToList(); public static IList GetCustomAttributes(Assembly asm) => getCustomAttributes(asm, asm.AssemblyDefinition.token, asm.AssemblyDefinition.customAttributeIndex); public static IList GetCustomAttributes(EventInfo evt) => getCustomAttributes(evt.Assembly, evt.Definition.token, evt.Definition.customAttributeIndex);