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