Work around thread safety issue in Melda plugins

This is super difficult to trigger on purpose, but I did run into it at
least once just now so it seems like a good idea to at least make sure
that this doesn't happen.
This commit is contained in:
Robbert van der Helm
2021-07-15 15:45:15 +02:00
parent 6b3f593bdb
commit 5f7fb2e2c3
3 changed files with 38 additions and 6 deletions
+13
View File
@@ -216,6 +216,19 @@ struct Vst3PluginInstance {
*/
std::optional<Vst3PlugViewInterfaces> plug_view_instance;
/**
* Used to make sure that `IPlugView::getSize()` can never be called at the
* same time as `IAudioProcessor::setProcessing()`.
*
* HACK: This really shouldn't be needed, but MeldaProduction plugins seem
* to deadlock when this happens. It's pretty tricky to reproduce the
* timing for making this happen (since opening the GUI also needs to
* be delayed slightly, like when opening a plugin from Bitwig's popup
* browser), but it seems like a good idea to make sure that this
* doesn't cause any freezes.
*/
std::mutex get_size_mutex;
/**
* This contains smart pointers to all VST3 plugin interfaces that can be
* casted from `object`.