Changeset 14927 for branches/PersistenceReintegration/HeuristicLab.Clients.Hive/3.3/HiveTasks/HiveTask.cs
- Timestamp:
- 05/04/17 17:19:35 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceReintegration/HeuristicLab.Clients.Hive/3.3/HiveTasks/HiveTask.cs
r14185 r14927 29 29 using HeuristicLab.Common; 30 30 using HeuristicLab.Core; 31 using HeuristicLab.Persistence .Default.CompositeSerializers.Storable;31 using HeuristicLab.Persistence; 32 32 using HeuristicLab.PluginInfrastructure; 33 33 … … 35 35 36 36 [Item("Hive Task", "Represents a hive task.")] 37 [Storable Class]37 [StorableType("0bf8fae8-e53b-4eed-a29a-fd73d8eaad6e")] 38 38 public class HiveTask : NamedItem, IItemTree<HiveTask>, IDisposable { 39 39 protected static object locker = new object(); … … 87 87 try { 88 88 childHiveTasks.Clear(); 89 } 90 finally { childHiveTasksLock.ExitWriteLock(); } 89 } finally { childHiveTasksLock.ExitWriteLock(); } 91 90 } 92 91 if (itemTask != value) { … … 96 95 itemTask = value; 97 96 RegisterItemTaskEvents(); 98 } 99 finally { itemTaskLock.ExitWriteLock(); } 97 } finally { itemTaskLock.ExitWriteLock(); } 100 98 OnItemTaskChanged(); 101 99 IsFinishedTaskDownloaded = true; … … 133 131 hiveJob.IsControllable = value; 134 132 } 135 } 136 finally { 133 } finally { 137 134 childHiveTasksLock.ExitReadLock(); 138 135 } … … 148 145 try { 149 146 return childHiveTasks.AsReadOnly(); 150 } 151 finally { childHiveTasksLock.ExitReadLock(); } 147 } finally { childHiveTasksLock.ExitReadLock(); } 152 148 } 153 149 } … … 194 190 try { 195 191 this.ItemTask = PersistenceUtil.Deserialize<ItemTask>(taskData.Data); 196 } 197 catch { 192 } catch { 198 193 this.ItemTask = null; 199 194 } … … 210 205 try { 211 206 this.childHiveTasks = cloner.Clone(original.childHiveTasks); 212 } 213 finally { original.childHiveTasksLock.ExitReadLock(); } 207 } finally { original.childHiveTasksLock.ExitReadLock(); } 214 208 this.syncTasksWithOptimizers = original.syncTasksWithOptimizers; 215 209 this.isFinishedTaskDownloaded = original.isFinishedTaskDownloaded; … … 260 254 try { 261 255 this.childHiveTasks.Add(hiveTask); 262 } 263 finally { childHiveTasksLock.ExitWriteLock(); } 256 } finally { childHiveTasksLock.ExitWriteLock(); } 264 257 } 265 258 … … 379 372 } 380 373 return tasks; 381 } 382 finally { childHiveTasksLock.ExitReadLock(); } 374 } finally { childHiveTasksLock.ExitReadLock(); } 383 375 } 384 376 … … 394 386 } 395 387 return null; 396 } 397 finally { childHiveTasksLock.ExitWriteLock(); } 388 } finally { childHiveTasksLock.ExitWriteLock(); } 398 389 } 399 390 … … 412 403 return result; 413 404 } 414 } 415 finally { childHiveTasksLock.ExitReadLock(); } 405 } finally { childHiveTasksLock.ExitReadLock(); } 416 406 } 417 407 return null; … … 428 418 child.RemoveByTaskId(taskId); 429 419 } 430 } 431 finally { childHiveTasksLock.ExitWriteLock(); } 420 } finally { childHiveTasksLock.ExitWriteLock(); } 432 421 } 433 422 … … 482 471 HiveServiceLocator.Instance.CallHiveService(s => s.PauseTask(child.task.Id)); 483 472 } 484 } 485 finally { childHiveTasksLock.ExitReadLock(); } 473 } finally { childHiveTasksLock.ExitReadLock(); } 486 474 } else { 487 475 HiveServiceLocator.Instance.CallHiveService(s => s.PauseTask(this.task.Id)); … … 496 484 HiveServiceLocator.Instance.CallHiveService(s => s.StopTask(child.task.Id)); 497 485 } 498 } 499 finally { childHiveTasksLock.ExitReadLock(); } 486 } finally { childHiveTasksLock.ExitReadLock(); } 500 487 } else { 501 488 HiveServiceLocator.Instance.CallHiveService(s => s.StopTask(this.task.Id)); … … 541 528 542 529 [Item("Hive Task", "Represents a hive task.")] 543 [Storable Class]530 [StorableType("ca112124-bb35-42fa-b2b7-e6367980eb8c")] 544 531 public class HiveTask<T> : HiveTask where T : ItemTask { 545 532
Note: See TracChangeset
for help on using the changeset viewer.