OpenDDRdotORG / OpenDDR-CSharp

C# Implementation of OpenDDR-Simple-API
https://github.com/OpenDDRmobi/openddr-csharp/
GNU General Public License v3.0
5 stars 3 forks source link

Thread safety #9

Open aristotelos opened 10 years ago

aristotelos commented 10 years ago

IService.GetPropertyValues is not thread safe. It throws:

[IndexOutOfRangeException: Index was outside the bounds of the array.]
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +14648891
   Oddr.Identificators.DeviceIdentificator.Get(UserAgent userAgent, Int32 confidenceTreshold) +592
   Oddr.ODDRService.GetPropertyValues(IEvidence evdnc) +733

I guess this is because of the device.PutProperty in DeviceIdentificator.Get.