Skip to content

Instantly share code, notes, and snippets.

@luksa
Created February 21, 2017 13:26
Show Gist options
  • Save luksa/6ea6c953ac429292a5538b7e33ab7222 to your computer and use it in GitHub Desktop.
Save luksa/6ea6c953ac429292a5538b7e33ab7222 to your computer and use it in GitHub Desktop.
if (foo == null) {
synchronized (this) {
if (foo == null) {
foo = createFoo();
}
}
}
return foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment