Created
June 30, 2020 21:17
-
-
Save theboreddev/c5997cde4dba7fe98f5a61695fb545d1 to your computer and use it in GitHub Desktop.
synchronized
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
| public class MyClass { | |
| private MyAppState myAppState; | |
| synchronized public void pleaseBlockMe() { | |
| // omitted code | |
| updateState(); | |
| // omitted code | |
| } | |
| private void updateState() { | |
| //some expensive operation | |
| } | |
| static class MyAppState { | |
| // some state logic here | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment