public virtual void TestMaybeRefreshBlockingLock()
{
// make sure that maybeRefreshBlocking releases the lock, otherwise other
// threads cannot obtain it.
Directory dir = NewDirectory();
RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
w.Dispose();
SearcherManager sm = new SearcherManager(dir, null);
ThreadClass t = new ThreadAnonymousInnerClassHelper2(this, sm);
t.Start();
t.Join();
// if maybeRefreshBlocking didn't release the lock, this will fail.
Assert.IsTrue(sm.MaybeRefresh(), "failde to obtain the refreshLock!");
sm.Dispose();
dir.Dispose();
}