Changeset 1379 for trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager/ConfigManager.cs
- Timestamp:
- 03/20/09 13:56:55 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager/ConfigManager.cs
r1132 r1379 100 100 /// <returns></returns> 101 101 public StatusCommons GetStatusForClientConsole() { 102 //Todo: Locking 102 103 StatusCommons st = new StatusCommons(); 103 104 st.ClientGuid = hardwareInfo.ClientId; … … 113 114 st.Jobs = new List<JobStatus>(); 114 115 115 foreach (KeyValuePair<long, Executor> kvp in engines) { 116 Executor e = kvp.Value; 117 st.Jobs.Add(new JobStatus { JobId = e.JobId, Progress = e.Progress, Since = e.CreationTime }); 116 lock (engines) { 117 foreach (KeyValuePair<long, Executor> kvp in engines) { 118 Executor e = kvp.Value; 119 st.Jobs.Add(new JobStatus { JobId = e.JobId, Progress = e.Progress, Since = e.CreationTime }); 120 } 118 121 } 119 122 return st; … … 123 126 Dictionary<long,double> prog = new Dictionary<long,double>(); 124 127 Dictionary<long, Executor> engines = Core.GetExecutionEngines(); 125 foreach (KeyValuePair<long, Executor> kvp in engines) { 126 Executor e = kvp.Value; 127 prog[e.JobId] = e.Progress; 128 lock (engines) { 129 foreach (KeyValuePair<long, Executor> kvp in engines) { 130 Executor e = kvp.Value; 131 prog[e.JobId] = e.Progress; 132 } 128 133 } 129 134 return prog;
Note: See TracChangeset
for help on using the changeset viewer.