Exemplo n.º 1
0
 public object Run()
 {
     return(_enclosing.IsPaused()
         ? null
         : _enclosing.HasNext()
             ? _enclosing
            .Next()
             : null);
 }
Exemplo n.º 2
0
        public virtual void TestTimeoutNext()
        {
            IPausableBlockingQueue4 queue = new PausableBlockingQueue();

            Assert.IsFalse(queue.IsPaused());
            queue.Pause();
            Assert.IsTrue(queue.IsPaused());
            object obj = new object();

            queue.Add(obj);
            Assert.IsTrue(queue.HasNext());
            Assert.IsNull(queue.TryNext());
            queue.Resume();
            Assert.AreSame(obj, queue.Next(50));
        }