Changeset 7222 for trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveTasks
- Timestamp:
- 12/21/11 16:57:14 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveTasks/OptimizerHiveTask.cs
r7219 r7222 140 140 } 141 141 } 142 } finally { childHiveTasksLock.ExitWriteLock(); } 142 } 143 finally { childHiveTasksLock.ExitWriteLock(); } 143 144 } 144 145 } … … 155 156 } 156 157 } 157 } finally { childHiveTasksLock.ExitWriteLock(); } 158 } 159 finally { childHiveTasksLock.ExitWriteLock(); } 158 160 } 159 161 } … … 165 167 this.childHiveTasks.Remove(this.GetChildByOptimizer(item.Value)); 166 168 } 167 } finally { childHiveTasksLock.ExitWriteLock(); } 169 } 170 finally { childHiveTasksLock.ExitWriteLock(); } 168 171 } 169 172 } … … 175 178 this.childHiveTasks.Remove(this.GetChildByOptimizer(item.Value)); 176 179 } 177 } finally { childHiveTasksLock.ExitWriteLock(); } 180 } 181 finally { childHiveTasksLock.ExitWriteLock(); } 178 182 } 179 183 } … … 197 201 } 198 202 199 childHiveTasksLock.EnterReadLock(); 200 OptimizerHiveTask child = (OptimizerHiveTask)this.ChildHiveTasks.Single(j => j.Task.Id == childTaskId); 201 try { 202 if (!optimizerTask.ComputeInParallel) { 203 IEnumerable<HiveTask> childs = this.ChildHiveTasks.Where(j => j.Task.Id == childTaskId); 204 //TODO: in very rare cases childs is empty. This shouldn't be the case and should be further investigated. 205 if (childs.Count() > 0) { 206 OptimizerHiveTask child = childs.First() as OptimizerHiveTask; 207 208 if (child != null && !optimizerTask.ComputeInParallel) { 203 209 child.syncTasksWithOptimizers = false; 204 210 child.ItemTask = optimizerTask; 205 211 child.syncTasksWithOptimizers = true; 206 212 } 207 } finally { childHiveTasksLock.ExitReadLock(); } 213 } 214 208 215 syncTasksWithOptimizers = true; 209 216 } … … 267 274 child.SetIndexInParentOptimizerList(this); 268 275 } 269 } finally { childHiveTasksLock.ExitReadLock(); } 276 } 277 finally { childHiveTasksLock.ExitReadLock(); } 270 278 } 271 279 … … 337 345 } 338 346 return null; 339 } finally { childHiveTasksLock.ExitReadLock(); } 347 } 348 finally { childHiveTasksLock.ExitReadLock(); } 340 349 } 341 350 … … 348 357 } 349 358 return null; 350 } finally { childHiveTasksLock.ExitReadLock(); } 359 } 360 finally { childHiveTasksLock.ExitReadLock(); } 351 361 } 352 362
Note: See TracChangeset
for help on using the changeset viewer.