Beispiel #1
0
 public SuspenderToken Get()
 {
     lock (_lock)
     {
         SuspenderToken s = new SuspenderToken(this);
         _list.Add(s);
         return(s);
     }
 }
Beispiel #2
0
        public void Resume(SuspenderToken s)
        {
            lock (_lock)
            {
                _list.Remove(s);
                if (_list.Count > 0)
                {
                    return;
                }
            }

//            try
            {
                _action?.Invoke();
            }
//            catch (Exception)
            {
            }
        }