public bool Take() { var taken = Interlocked.CompareExchange(ref _taken, Taken, NotTaken) == NotTaken; if (taken) { OnTake?.Invoke(this); } return(taken); }
public void Take() { OnTake?.Invoke(); }