コード例 #1
0
 private float _get(string label, QueueCapacities.CapacityType type)
 {
     try
     {
         readLock.Lock();
         QueueCapacities.Capacities cap = capacitiesMap[label];
         if (null == cap)
         {
             return(LabelDoesntExistCap);
         }
         return(cap.capacitiesArr[type.idx]);
     }
     finally
     {
         readLock.Unlock();
     }
 }
コード例 #2
0
 private void _set(string label, QueueCapacities.CapacityType type, float value)
 {
     try
     {
         writeLock.Lock();
         QueueCapacities.Capacities cap = capacitiesMap[label];
         if (null == cap)
         {
             cap = new QueueCapacities.Capacities();
             capacitiesMap[label] = cap;
         }
         cap.capacitiesArr[type.idx] = value;
     }
     finally
     {
         writeLock.Unlock();
     }
 }