public void Init()
        {
            s = Client.GetSemaphore(TestSupport.RandomString());

            s.ReducePermits(100);
            s.Release(9);
            s.Release();
        }
Beispiel #2
0
        public void Init()
        {
            s = Client.GetSemaphore(TestSupport.RandomString());

            s.ReducePermits(100);
            s.Release(9);
            s.Release();
        }
Beispiel #3
0
        public void TestNegativePermitsJucCompatibility()
        {
            semaphore.Init(0);
            semaphore.ReducePermits(100);
            semaphore.Release(10);

            Assert.AreEqual(-90, semaphore.AvailablePermits());
            Assert.AreEqual(-90, semaphore.DrainPermits());

            semaphore.Release(10);

            Assert.AreEqual(10, semaphore.AvailablePermits());
            Assert.AreEqual(10, semaphore.DrainPermits());
        }