Changeset 9170
- Timestamp:
- 01/16/13 14:21:14 (12 years ago)
- Location:
- branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/ConcurrentTaskDownloader.cs
r9169 r9170 39 39 downloadSemaphore = new Semaphore(concurrentDownloads, concurrentDownloads); 40 40 deserializeSemaphore = new Semaphore(concurrentDeserializations, concurrentDeserializations); 41 TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException);42 41 } 43 42 … … 102 101 } 103 102 104 private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) {105 e.SetObserved(); // avoid crash of process because task crashes. first exception found is handled in Results property106 OnExceptionOccured(new HiveException("Unobserved Exception in ConcurrentTaskDownloader", e.Exception));107 }108 109 103 public event EventHandler<EventArgs<Exception>> ExceptionOccured; 110 104 private void OnExceptionOccured(Exception exception) { … … 115 109 #region IDisposable Members 116 110 public void Dispose() { 117 TaskScheduler.UnobservedTaskException -= new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException);118 111 deserializeSemaphore.Dispose(); 119 112 downloadSemaphore.Dispose(); -
branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r9169 r9170 76 76 #endregion 77 77 78 private HiveClient() { } 78 private HiveClient() { 79 //this will never be deregistered 80 TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException); 81 } 82 83 private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) { 84 e.SetObserved(); // avoid crash of process because task crashes. first exception found is handled in Results property 85 throw new HiveException("Unobserved Exception in ConcurrentTaskDownloader", e.Exception); 86 } 79 87 80 88 public void ClearHiveClient() { -
branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/TaskDownloader.cs
r9169 r9170 123 123 taskDownloader.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(taskDownloader_ExceptionOccured); 124 124 resultsLock.Dispose(); 125 taskDownloader.Dispose(); 125 126 } 126 127 #endregion
Note: See TracChangeset
for help on using the changeset viewer.