WorkItemIsQueued() private method

private WorkItemIsQueued ( ) : void
return void
Exemplo n.º 1
0
 // Token: 0x060017EB RID: 6123
 // RVA: 0x00073FD0 File Offset: 0x000721D0
 internal override void Enqueue(WorkItem workItem_0)
 {
     this.IncrementWorkItemsCount();
     workItem_0.CanceledSmartThreadPool = this._canceledSmartThreadPool;
     this._workItemsQueue.EnqueueWorkItem(workItem_0);
     workItem_0.WorkItemIsQueued();
     if (this._currentWorkItemsCount > this._workerThreads.Count)
     {
         this.StartThreads(1);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Put a new work item in the queue
        /// </summary>
        /// <param name="workItem">A work item to queue</param>
        internal void Enqueue(WorkItem workItem, bool incrementWorkItems)
        {
            // Make sure the workItem is not null
            Debug.Assert(null != workItem);

            if (incrementWorkItems)
            {
                IncrementWorkItemsCount();
            }

            _workItemsQueue.EnqueueWorkItem(workItem);
            workItem.WorkItemIsQueued();

            // If all the threads are busy then try to create a new one
            if ((InUseThreads + WaitingCallbacks) > _workerThreads.Count) 
            {
                StartThreads(1);
            }
        }