Beispiel #1
0
        public async Task WaitAndReleaseAllAsync()
        {
            var semaphore = new AsyncSemaphore(10, 10);

            var acquire = await semaphore.WaitAndReleaseAllAsync();

            Assert.Equal(0, semaphore.CurrentCount);
            acquire.Dispose();
            Assert.Equal(10, semaphore.CurrentCount);
        }