예제 #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();
     }
 }