Ejemplo n.º 1
0
 public virtual void CheckGroups(int size)
 {
     lock (this)
     {
         if (firstViolation != null)
         {
             throw new LimitExceededException(firstViolation);
         }
         int groupsMax = GetGroupsMax();
         if (size > groupsMax)
         {
             firstViolation = new LimitExceededException("Too many counter groups: " + size +
                                                         " max=" + groupsMax);
         }
     }
 }
Ejemplo n.º 2
0
 public virtual void CheckCounters(int size)
 {
     lock (this)
     {
         if (firstViolation != null)
         {
             throw new LimitExceededException(firstViolation);
         }
         int countersMax = GetCountersMax();
         if (size > countersMax)
         {
             firstViolation = new LimitExceededException("Too many counters: " + size + " max="
                                                         + countersMax);
             throw firstViolation;
         }
     }
 }