-
-
Notifications
You must be signed in to change notification settings - Fork 753
Closed
Description
ModuleBuilder.DefineType is not thread-safe, it causes errors in Android environment in case of concurrent execution.
https://msdn.microsoft.com/en-us/library/system.reflection.emit.modulebuilder%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396#Anchor_9
It is wrapped in lock in Microsoft implementation: https://github.com/Microsoft/referencesource/blob/master/mscorlib/system/reflection/emit/modulebuilder.cs#L1141
But it isn't in Mono implementation:
https://github.com/mono/mono/blob/master/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs#L274
To fix wrap usage with lock in DynamicObjectTypeBuilder BuildType method.
Metadata
Metadata
Assignees
Labels
No labels