示例#1
0
        private void ProcessOptionsChange(object sender, PrioritySchedulerOptionsChangedEventArgs e)
        {
            int queueCount = Math.Min(e.NewThreadCountsByPriority.Count, _queuesByPriority.Length);

            for (int priority = 0; priority < queueCount; priority++)
            {
                _queuesByPriority[priority].ThreadCount = e.NewThreadCountsByPriority[priority];
            }
        }
示例#2
0
        public void ChangeThreadCounts(params int[] newThreadCountsByPriority)
        {
            var oldThreadCountsByPriority = ThreadCountsByPriority;

            ThreadCountsByPriority = newThreadCountsByPriority;
            var eventArgs = new PrioritySchedulerOptionsChangedEventArgs
            {
                OldThreadCountsByPriority = oldThreadCountsByPriority,
                NewThreadCountsByPriority = newThreadCountsByPriority
            };

            OnChanged(eventArgs);
        }
示例#3
0
 protected void OnChanged(PrioritySchedulerOptionsChangedEventArgs eventArgs)
 {
     Changed?.Invoke(this, eventArgs);
 }