hc
hc copied to clipboard
address data races
there are some data races that can be spotted by running _example/example
with -race
, especially after changing the sleep interval to <1s.
to note: the data race in Characteristic
's updateValue
/getValue
probably needs a better solution, maybe some refactoring, than just using locks:
- calling
SetValue
orGetValue
insideOnValueRemoteUpdate
now locks forever (but i'm not sure if it actually makes sense to do so in the first place) - it's still possible to cause a data race by reading and writing to the
Value
field directly