コード例 #1
0
        private (int, Func <ValueTask>[]) Drain()
        {
            bool lockTaken = false;

            try
            {
                _spinLock.Enter(ref lockTaken);

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