Changeset 163


Ignore:
Timestamp:
03/09/08 12:27:00 (7 years ago)
Author:
lowjoel
Message:

Added Docs for the DirectExecutor? class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/DirectExecutor.cs

    r152 r163  
    8787        } 
    8888 
     89        /// <summary> 
     90        /// The thread entry point for this object. This object operates on a queue 
     91        /// and hence the thread will sequentially execute tasks. 
     92        /// </summary> 
    8993        private void Main() 
    9094        { 
     
    111115                    //Run the task 
    112116                    ; 
     117 
     118                    //If the task is a recurring task, reschedule it since we are done. 
     119                    if (task.Schedule is RecurringSchedule) 
     120                        ((RecurringSchedule)task.Schedule).Reschedule(DateTime.Now); 
    113121                } 
    114122 
     
    118126        } 
    119127 
     128        /// <summary> 
     129        /// The thread object. 
     130        /// </summary> 
    120131        private Thread thread; 
    121132 
     133        /// <summary> 
     134        /// The lock preventing concurrent access for the tasks list and the 
     135        /// tasks queue. 
     136        /// </summary> 
    122137        private object tasksLock = new object(); 
     138 
     139        /// <summary> 
     140        /// The list of tasks. Includes all immediate, reboot, and recurring tasks 
     141        /// </summary> 
    123142        private Dictionary<uint, Task> tasks = new Dictionary<uint, Task>(); 
     143 
     144        /// <summary> 
     145        /// The queue of tasks. This queue is executed when the first element's 
     146        /// timestamp (the key) has been past. This list assumes that all tasks 
     147        /// are sorted by timestamp, smallest one first. 
     148        /// </summary> 
    124149        private SortedList<DateTime, Task> scheduledTasks = 
    125150            new SortedList<DateTime, Task>(); 
    126151 
     152        /// <summary> 
     153        /// The list of task IDs for recycling. 
     154        /// </summary> 
    127155        private List<uint> unusedIds = new List<uint>(); 
     156 
     157        /// <summary> 
     158        /// Lock preventing concurrent access for the IDs. 
     159        /// </summary> 
    128160        private object unusedIdsLock = new object(); 
     161 
     162        /// <summary> 
     163        /// Incrementing ID. This value is incremented by one every time an ID 
     164        /// is required by no unused IDs remain. 
     165        /// </summary> 
    129166        private uint nextId = 0; 
    130167 
     168        /// <summary> 
     169        /// An automatically reset event allowing the addition of new tasks to 
     170        /// interrupt the thread's sleeping state waiting for the next recurring 
     171        /// task to be due. 
     172        /// </summary> 
    131173        AutoResetEvent schedulerInterrupt = new AutoResetEvent(true); 
    132174    } 
Note: See TracChangeset for help on using the changeset viewer.