Changeset 163
- Timestamp:
- 3/9/2008 12:27:00 PM (5 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Manager/DirectExecutor.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Manager/DirectExecutor.cs
r152 r163 87 87 } 88 88 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> 89 93 private void Main() 90 94 { … … 111 115 //Run the task 112 116 ; 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); 113 121 } 114 122 … … 118 126 } 119 127 128 /// <summary> 129 /// The thread object. 130 /// </summary> 120 131 private Thread thread; 121 132 133 /// <summary> 134 /// The lock preventing concurrent access for the tasks list and the 135 /// tasks queue. 136 /// </summary> 122 137 private object tasksLock = new object(); 138 139 /// <summary> 140 /// The list of tasks. Includes all immediate, reboot, and recurring tasks 141 /// </summary> 123 142 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> 124 149 private SortedList<DateTime, Task> scheduledTasks = 125 150 new SortedList<DateTime, Task>(); 126 151 152 /// <summary> 153 /// The list of task IDs for recycling. 154 /// </summary> 127 155 private List<uint> unusedIds = new List<uint>(); 156 157 /// <summary> 158 /// Lock preventing concurrent access for the IDs. 159 /// </summary> 128 160 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> 129 166 private uint nextId = 0; 130 167 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> 131 173 AutoResetEvent schedulerInterrupt = new AutoResetEvent(true); 132 174 }
Note: See TracChangeset
for help on using the changeset viewer.
