protected void ToBreakpoint(ISearcher search, Waiter waiter, int id) { uint breakpoint = waiter.Breakpoints[id].Value; if (waiter.Count > breakpoint) { search.CancelSearch(); } if (waiter.Count != breakpoint) { search.BeginSearch(); while (true) { while (!waiter.IsPaused) { Task.Delay(20).Wait(20); } if (waiter.Count >= breakpoint) { break; } waiter.Pause = false; waiter.PulseAll(); } } waiter.Pause = true; }