public void CanAcquireAndReleaseUpgradeableReadLock()
        {
            var l = new ReaderWriterLockSlimEx();

            using (l.AcquireUpgradeableReadLock())
            {
                // access lock here so it's not optimized-away after release build
                Assert.IsNotNull(l);
            }
        }
        public void UpgradeableReadLockIsHeld__AnotherThreadDoesNotBlockOnUpgradeableReadLockAcquisition()
        {
            // NOTE:    this is how Reader Writer Lock Slim works
            //          only one thread can own Upgradeable Read Lock at the time

            var l = new ReaderWriterLockSlimEx();

            using (l.AcquireUpgradeableReadLock())
            {
                Task.Factory.StartNew(() =>
                {
                    var acquisition = (IUpgradeableReadLockAcquisition)null;

                    if (l.TryAcquireUpgradeableReadLock(TEST_DefaultTimeout, out acquisition))
                    {
                        Assert.Fail();
                    }

                }).Wait();
            }
        }