public static ProjectCollectionScope GetProjectCollectionScope() { lock (s_syncLock) { s_projectCollectionUseCount++; if ((s_projectCollectionUseCount % ProjectCollectionUseThreshold) == 0) { s_completionTracker?.OnComplete(); s_completionTracker = new CompletionTracker(); s_projectCollection = new ProjectCollection(); s_completionTracker.OnStart(); DisposeOnCompletion(s_completionTracker, s_projectCollection); } return(new ProjectCollectionScope(s_projectCollection, s_completionTracker)); } }
private void QueueDirectory(string directory, CompletionTracker tracker, BlockingCollection <string> directories) { tracker.OnStart(); directories.Add(directory); }