/// <summary> /// Releases all the work from the current <see cref="CrawlerWorkSource"/>,making it unavailable. /// </summary> public void DisposeSource() { IsSourceReleased = true; if (workSourceScheduler != null) { workSourceScheduler.Stop(); workSourceScheduler = null; } ManualResetEvent handle; while (freeCrawlers.TryDequeue(out handle)) { handle.Set(); } availableWork = new ConcurrentQueue <IWork>(); }