- Timestamp:
- 11/17/15 09:58:35 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/EvaluationCache.cs
r13180 r13203 52 52 private byte[] rawMessage; 53 53 54 private object lockObject = new object(); 55 54 56 public byte[] RawMessage { 55 57 get { return rawMessage; } 56 58 set { 57 rawMessage = value; 58 message = null; 59 lock (lockObject) { 60 rawMessage = value; 61 message = null; 62 } 59 63 } 60 64 } … … 65 69 66 70 public QualityMessage GetMessage(ExtensionRegistry extensions) { 67 if (message == null && rawMessage != null) 68 message = QualityMessage.ParseFrom(ByteString.CopyFrom(rawMessage), extensions); 71 lock (lockObject) { 72 if (message == null && rawMessage != null) 73 message = QualityMessage.ParseFrom(ByteString.CopyFrom(rawMessage), extensions); 74 } 69 75 return message; 70 76 } 71 77 public void SetMessage(QualityMessage value) { 72 message = value; 73 rawMessage = value.ToByteArray(); 78 lock (lockObject) { 79 message = value; 80 rawMessage = value.ToByteArray(); 81 } 74 82 } 75 83 … … 164 172 #region BackwardsCompatibility3.4 165 173 [Storable(Name = "Cache")] 166 private IEnumerable<KeyValuePair<string, double>> Cache_Persistence {174 private IEnumerable<KeyValuePair<string, double>> Cache_Persistence_backwardscompatability { 167 175 get { return Enumerable.Empty<KeyValuePair<string, double>>(); } 168 176 set { … … 179 187 #endregion 180 188 [Storable(Name = "CacheNew")] 181 private IEnumerable<KeyValuePair<string, byte[]>> Cache New_Persistence {189 private IEnumerable<KeyValuePair<string, byte[]>> Cache_Persistence { 182 190 get { return IsPersistent ? GetCacheValues() : Enumerable.Empty<KeyValuePair<string, byte[]>>(); } 183 191 set { SetCacheValues(value); }
Note: See TracChangeset
for help on using the changeset viewer.