Can method inlining optimization cause race conditions?

后端 未结 3 938
感动是毒
感动是毒 2020-12-30 04:19

As seen in this question: Raising C# events with an extension method - is it bad?

I\'m thinking of using this extension method to safely raise an event:



        
3条回答
  •  清酒与你
    2020-12-30 04:57

    With correct code, optimizations should not change its semantics. Therefore no error can be introduced by the optimizer, if the error was not in the code already.

提交回复
热议问题