adamsutton/xbmc-pvr-addons — pull request #29 by Jalle19 (2014-04-12 08:41:49+00:00)
Title: Improve locking when dealing with streams

After some log analyzes I noticed that m_streams (the stream vector) and m_streamStat (the stats map) is accessed from multiple threads (at least two). The first commit simply wraps a lock around the members when they are accessed. The second commit extends the lock scope in ParseSubscriptionStart to encompass the whole stream updating process, which means we can get rid of the start condition that was previously only used in the GetCurrentStreams method.

Ideally m_streams (which is a glorified wrapper around a std::vector) should implement the locking itself so that users don't have to bother with it (both pvr.hts and pvr.vdr.vnsi is missing locking) but that's something for after this addon has been (hopefully) merged into the official addon repository.