public SemaphoreSlim (int initial, int max) { if (initial < 0 || initial > max || max < 0) throw new ArgumentOutOfRangeException ("The initial argument is negative, initial is greater than max, or max is not positive."); this.max = max; this.currCount = initial; }