Add mutexes for the VST3 data caches

Since the restart will always be called from another thread, and when a
plugin asks for a restart during initialization this can quickly lead to
issues.
This commit is contained in:
Robbert van der Helm
2021-01-30 23:26:57 +01:00
parent 27370ab54b
commit 81d401f06a
2 changed files with 94 additions and 56 deletions
@@ -487,6 +487,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
* does that.
*/
std::optional<BusInfoCache> processing_bus_cache;
std::mutex processing_bus_cache_mutex;
/**
* A cache for `IEditController::getParameterCount()` and
@@ -513,4 +514,5 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
* information four times per second.
*/
ParameterInfoCache parameter_info_cache;
std::mutex parameter_info_cache_mutex;
};