Beispiel #1
0
 private (int, Action[]) Drain()
 {
     lock (_lock)
     {
         return(_queue.Drain());
     }
 }
Beispiel #2
0
 private (int, Func <Task>[]) Drain()
 {
     lock (_lock)
     {
         return(_queue.Drain());
     }
 }
Beispiel #3
0
        private (int, Action[]) Drain()
        {
            bool lockTaken = false;

            try
            {
                _spinLock.Enter(ref lockTaken);

                return(_queue.Drain());
            }
            finally
            {
                if (lockTaken)
                {
                    _spinLock.Exit(false);
                }
            }
        }