neuecc / Utf8Json

Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).
MIT License
2.36k stars 267 forks source link

Threadsafe issue for mono #125

Open adamsco opened 5 years ago

adamsco commented 5 years ago

When creating a lot of formatters simultaneously in Mono I get the error: System.TypeLoadException: Could not load type 'Utf8Json.Formatters.Shared_Misc_UnitFormatter50' from assembly ''. occurred.

Seems to be a threadsafety issue, created a pull request with a lock for BuildFormatterToAssembly that solves the issue for me.