コード例 #1
0
 public static ExchangeRateHolder GetInstance()
 {
     if (INSTANCE == null)
     {
         INSTANCE = new ExchangeRateHolder();
     }
     return INSTANCE;
 }
コード例 #2
0
 public static ExchangeRateHolder GetInstanceThreadSafe()
 {
     if (INSTANCE == null)
     {
         lock (MONITOR)
         {
             if (INSTANCE == null)
             {
                 INSTANCE = new ExchangeRateHolder();
             }
         }
     }
     return INSTANCE;
 }