public void WaitingThreads()
 {
     WaitNode node = new WaitNode();
     FIFOWaitQueue queue = new FIFOWaitQueue();
     Assert.AreEqual(0, queue.WaitingThreads.Count);
     Assert.IsFalse(queue.IsWaiting(Thread.CurrentThread));
     queue.Enqueue(node);
     Assert.AreEqual(1, queue.WaitingThreads.Count);
     Assert.IsTrue(queue.IsWaiting(Thread.CurrentThread));
 }
예제 #2
0
        public void WaitingThreads()
        {
            WaitNode      node  = new WaitNode();
            FIFOWaitQueue queue = new FIFOWaitQueue();

            Assert.AreEqual(0, queue.WaitingThreads.Count);
            Assert.IsFalse(queue.IsWaiting(Thread.CurrentThread));
            queue.Enqueue(node);
            Assert.AreEqual(1, queue.WaitingThreads.Count);
            Assert.IsTrue(queue.IsWaiting(Thread.CurrentThread));
        }
예제 #3
0
        public void IsWaitingWithNullThread()
        {
            FIFOWaitQueue queue = new FIFOWaitQueue();

            Assert.IsFalse(queue.IsWaiting(null));
        }
 public void IsWaitingWithNullThread()
 {
     FIFOWaitQueue queue = new FIFOWaitQueue();
     Assert.IsFalse(queue.IsWaiting(null));
 }