public override void Sync(ICollection<string> names)
{
lock (this)
{
MaybeYield();
MaybeThrowDeterministicException();
if (Crashed)
{
throw new System.IO.IOException("cannot sync after crash");
}
// don't wear out our hardware so much in tests.
if (LuceneTestCase.Rarely(RandomState) || MustSync())
{
foreach (string name in names)
{
// randomly fail with IOE on any file
MaybeThrowIOException(name);
@in.Sync(new[] { name });
UnSyncedFiles.Remove(name);
}
}
else
{
UnSyncedFiles.RemoveAll(names);
}
}
}