internal void Remove(LoadFragment loadFragment)
 {
     if (loadFragment.PriorityQueueElement.Valid)
     {
         this.jobList.Remove(loadFragment.PriorityQueueElement);
     }
     this.totalLoad           -= loadFragment.PreviousLoad;
     loadFragment.PreviousLoad = 0;
     loadFragment.SetManagerInternal(null);
 }
        private void DoReserve(LoadFragment loadFragment)
        {
            if (loadFragment.PriorityQueueElement.Valid)
            {
                return;
            }
            if (loadFragment.Manager == null)
            {
                loadFragment.SetManagerInternal(this);
                loadFragment.InvokeManagerAssign();
            }
            int previousLoad = loadFragment.PreviousLoad;
            int load         = loadFragment.Load;

            loadFragment.PreviousLoad = load;
            this.totalLoad           += load - previousLoad;
            if (load != 0)
            {
                loadFragment.PriorityQueueElement.Value    = loadFragment;
                loadFragment.PriorityQueueElement.Priority = loadFragment.Priority;
                this.jobList.Add(loadFragment.PriorityQueueElement);
                this.threadLoad.Load = this.totalLoad;
            }
        }