Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@FrannyZhao
Created May 27, 2019 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrannyZhao/6eeec7b88433c554054cf8b6ddd05f8f to your computer and use it in GitHub Desktop.
Save FrannyZhao/6eeec7b88433c554054cf8b6ddd05f8f to your computer and use it in GitHub Desktop.
private static volatile TCPMessageHandler instance = null;
public static TCPMessageHandler getInstance() {
if (instance == null) {
synchronized (TCPMessageHandler.class) {
if (instance == null) {
instance = new TCPMessageHandler();
}
}
}
return instance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment