public virtual void TestLock() { mm.Lock("key1"); var latch = new CountdownEvent(1); var t = new Thread(delegate(object o) { if (!mm.TryLock("key1")) { latch.Signal(); } }); t.Start(); Assert.IsTrue(latch.Wait(TimeSpan.FromSeconds(5))); mm.ForceUnlock("key1"); }