Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

prevent creating instance of singleton from thread

// for java
// ** use 'synchronized' keyword in function declaration

public static synchronized Database getInstance(){...}
 
PREVIOUS NEXT
Tagged: #prevent #creating #instance #singleton #thread
ADD COMMENT
Topic
Name
1+3 =