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