Exemple #1
0
 private T getInternal() {
   T result = instance;
   if (null == result) {
     instance = result = creation.call();
   }
   return result;
 }
Exemple #2
0
 private T getInternalSync() {
   T result = instance;
   if (null == result) {
     synchronized (this) {
       result = instance;
       if (null == result) {
         instance = result = creation.call();
       }
     }
   }
   return result;
 }