An item in the thread pool.
Ejemplo n.º 1
0
 internal void TaskFinished(PoolItem poolItem)
 {
     lock (this)
     {
         this.activeTasks--;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Process the specified task.  It will be processed either now,
 /// or queued to process on the thread pool.
 /// </summary>
 /// <param name="task">The task to process.</param>
 /// <param name="group">The group this task belongs to.</param>
 public void ProcessTask(IEngineTask task, TaskGroup  group)
 {
     lock (this)
     {
         this.activeTasks++;
     }
     if( group!=null )
         group.TaskStarting();
     PoolItem item = new PoolItem(this, task, group);
     ThreadPool.QueueUserWorkItem(item.ThreadPoolCallback);
 }