Ejemplo n.º 1
0
 internal void OnTaskCompleted(ChromatogramGeneratorTask chromatogramGeneratorTask)
 {
     lock (LockObj)
     {
         _completedCount++;
         _executingTasks.Remove(chromatogramGeneratorTask);
         Monitor.PulseAll(LockObj);
         EnsureMinTasksRunning();
     }
 }
Ejemplo n.º 2
0
 private void StartTask(ChromatogramGeneratorTask task)
 {
     lock (this)
     {
         if (task.IsStarted())
         {
             return;
         }
         task.Start();
         _executingTasks.Add(task);
     }
 }
Ejemplo n.º 3
0
 public ChromTaskList(Action checkCancelledAction, SrmDocument srmDocument, ChorusAccount chorusAccount, ChorusUrl chorusUrl, IEnumerable <ChromatogramRequestDocument> chromatogramRequestDocuments)
 {
     SrmDocument                 = srmDocument;
     ChorusSession               = new ChorusSession(chorusAccount);
     _checkCancelledAction       = checkCancelledAction;
     _chromatogramGeneratorTasks = new List <ChromatogramGeneratorTask>();
     _chromKeys = new Dictionary <ChromKey, ChromatogramGeneratorTask>();
     foreach (var chunk in chromatogramRequestDocuments)
     {
         ChromatogramGeneratorTask task = new ChromatogramGeneratorTask(this, chorusAccount, chorusUrl, chunk);
         _chromatogramGeneratorTasks.Add(task);
         foreach (ChromKey chromKey in ListChromKeys(chunk))
         {
             _chromKeys[chromKey] = task;
         }
     }
     _executingTasks = new HashSet <ChromatogramGeneratorTask>();
 }