Created
August 6, 2018 14:26
-
-
Save zzandy/eeaef75823f253d63b813d4d3b934c5c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsedInMultipleThreads | |
{ | |
private int counter; | |
public void MethodWithoutLocks() { | |
this.counter = 800; | |
} | |
public void MethodWithLocks() { | |
lock(this) { | |
... | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment