public void Viewed(T item)
 {
     _messages.UpgradeableReadLock(x =>
     {
         if (!x.Contains(item))
         {
             _messages.WriteLock(y => y.Add(item));
         }
     });
 }
Beispiel #2
0
        public void An_upgradable_lock_with_a_timeout_should_work()
        {
            string value = string.Empty;

            bool locked = _value.UpgradeableReadLock(1.Seconds(), x => { value = x; });

            Assert.IsTrue(locked);
            //Assert.That(locked, Is.True, "Unable to obtain lock");

            Assert.AreEqual(_initialValue, value);
            //Assert.That(value, Is.EqualTo(_initialValue));
        }