Example #1
0
 public void Release(MapIdentifier identifier)
 {
     _availableStack.Push(identifier);
 }
Example #2
0
        public MapIdentifier Get()
        {
            MapIdentifier identifier;
            if (!_availableStack.TryPop(out identifier))
            {
                int newId = Interlocked.Increment(ref _lastGeneratedId);
                identifier = new MapIdentifier(newId);
            }

            return identifier;
        }