internal static void Finish(SecurityActivity activity) { lock (_waitingSetLock) { // activity is done in the ActivityQueue _waitingSet.Remove(activity); // terminate and release waiting threads if there is any. activity.Finish(); // register activity termination in the log. SecurityActivityHistory.Finish(activity.Id); // register activity termination. TerminationHistory.FinishActivity(activity); // execute all activities that are completely freed. foreach (var dependentItem in activity.WaitingForMe.ToArray()) { dependentItem.FinishWaiting(activity); if (dependentItem.WaitingFor.Count == 0) { Task.Run(() => Executor.Execute(dependentItem)); } } } }
internal static void Finish(IndexingActivityBase activity) { lock (WaitingSetLock) { // activity is done in the ActivityQueue WaitingSet.Remove(activity); // terminate and release waiting threads if there is any. activity.Finish(); // register activity termination in the log. IndexingActivityHistory.Finish(activity.Id); // register activity termination if the activity was not skipped. if (activity.Executed) { TerminationHistory.FinishActivity(activity); } // execute all activities that are completely freed. foreach (var dependentItem in activity.WaitingForMe.ToArray()) { dependentItem.FinishWaiting(activity); if (dependentItem.WaitingFor.Count == 0) { System.Threading.Tasks.Task.Run(() => Executor.Execute(dependentItem)); } } } }