I've been struggling with a crash in an audio plug-in when running in Ableton Live! It occured when modifying a parameter by moving Ableton-provided slider. It turned out that Ableton calls parameter change method on a thread other than main one. As my plug-in relies heavily on juce::Value, any parameter change results in juce::Value::setValue call. This queues a value change message for future asynchronous delivery, which is performed by the main app thread. This is where the problem occurs.
It seems that SharedValueSourceUpdater::sourcesNeedingAnUpdate and SharedValueSourceUpdater::sourcesBeingIterated need to be protected against concurrent access to avoid the crash in my case. By using scoped locks in SharedValueSourceUpdater's update, valueDeleted and handleAsyncUpdate (the part where sources are swapped) methods I could fix it, but this requires the change in Juce code. Do you think there's a workaround? I definitely want to use juce::Value - I like it's listener notification mechanism which makes my (already complex) code a lot less complicated. There doesn't seem to be a way of making juce::Value thread-safe (no macro or template argument I could use to provide a critical section or whatever).