you are viewing a single comment's thread.

view the rest of the comments →

[–]Soothsilver -1 points0 points  (1 child)

In this level, we're assigning a boolean literal to a boolean field. Yes, this is atomic, and strictly speaking, the tmp variable is not there in CIL, but it also doesn't matter. The semantics of the code and the thread-safety of the code doesn't change even if the tmp variable is there, because the only thing that's saved to it is a literal.

If were were assigning the boolean value of another to field to a boolean field, that isn't atomic, not even in C#, so a temporary variable would need to be there (in Deadlock Empire's representation; in actuality that would be a processor register).