예제 #1
0
        public bool Take()
        {
            var taken = Interlocked.CompareExchange(ref _taken, Taken, NotTaken) == NotTaken;

            if (taken)
            {
                OnTake?.Invoke(this);
            }
            return(taken);
        }
예제 #2
0
 public void Take()
 {
     OnTake?.Invoke();
 }