Beispiel #1
0
 public void EnqueueForFinalization(PTThreadTask task)
 {
     lock (m_lock)
     {
         m_tasksToFinish.Enqueue(task);
         Monitor.Pulse(m_lock);
     }
 }
 public void Enqueue(PTTimePair endTime, PTThreadTask task)
 {
     lock (m_lock)
     {
         m_queue.Enqueue(endTime, task);
         Monitor.Pulse(m_lock);
     }
 }
Beispiel #3
0
 private void StartTasks()
 {
     foreach (var task in m_tasks)
     {
         if (!task.ShouldExecute())
         {
             continue;
         }
         var threadTask = PTThreadTask.Borrow(task.EndTime, task);
         m_controller.Enqueue(threadTask.RunInitializer());
     }
 }
Beispiel #4
0
 public static void Release(PTThreadTask task)
 {
     task.Release();
 }
Beispiel #5
0
 private static void OnRelease(PTThreadTask task)
 {
     PTTask.OnRelease(task);
     task.argument = null;
 }
Beispiel #6
0
 /// <summary>
 /// Can be called from any thread, TaskGroup has the lock
 /// </summary>
 /// <param name="finalizer"></param>
 internal void EnqueueForFinalization(PTThreadTask finalizer)
 {
     Tasks[finalizer.EndTime].EnqueueForFinalization(finalizer);
 }
Beispiel #7
0
 /// <summary>
 /// Only ever called from main thread by TaskGroup.StartTasks()
 /// </summary>
 /// <param name="task"></param>
 internal void Enqueue(PTThreadTask task)
 {
     m_threadPool.Enqueue(task);
     m_counters[task.EndTime]++;
 }
Beispiel #8
0
 internal void Enqueue(PTTimePair endTime, PTThreadTask task)
 {
     m_tasks[endTime].Enqueue(task);
     m_count++;
 }
Beispiel #9
0
 public void Enqueue(PTThreadTask task)
 {
     Enqueue(task.EndTime, task);
 }