As pointed out in dotnet/runtime#103085 (comment), lock shouldn't use new Lock type in the Monitor, as it might misbehave.
We can't use fslib special syntax for it to have separate implementation, since the type is not in the netstandard.
Two other ways for having its implementation separated for Lock and other types are
- Make it a compiler intrinsic, which is probably a "no" for us.
- Check the type in runtime, which might impact performance, since we'll have to use reflection for it, as well as might be a breaking change for some of the customers.
As pointed out in dotnet/runtime#103085 (comment), lock shouldn't use new Lock type in the Monitor, as it might misbehave.
We can't use fslib special syntax for it to have separate implementation, since the type is not in the netstandard.
Two other ways for having its implementation separated for Lock and other types are