mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Get rid of no longer used mutex
This was left over from a very early version of yabridge. It's not needed since we have to initialize all VST2 plugins from the same thread anyways.
This commit is contained in:
@@ -31,11 +31,6 @@ using VstEntryPoint = AEffect*(VST_CALL_CONV*)(audioMasterCallback);
|
|||||||
* from an `AEffect` when it performs a host callback during its initialization.
|
* from an `AEffect` when it performs a host callback during its initialization.
|
||||||
*/
|
*/
|
||||||
Vst2Bridge* current_bridge_instance = nullptr;
|
Vst2Bridge* current_bridge_instance = nullptr;
|
||||||
/**
|
|
||||||
* Needed for the rare event that two plugins are getting initialized at the
|
|
||||||
* same time.
|
|
||||||
*/
|
|
||||||
std::mutex current_bridge_instance_mutex;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opcodes that should always be handled on the main thread because they may
|
* Opcodes that should always be handled on the main thread because they may
|
||||||
@@ -101,12 +96,10 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
|
|||||||
|
|
||||||
sockets.connect();
|
sockets.connect();
|
||||||
|
|
||||||
// Initialize after communication has been set up
|
// Initialize after communication has been set up We'll try to do the same
|
||||||
// We'll try to do the same `get_bridge_instance` trick as in
|
// `get_bridge_instance` trick as in `plugin/bridges/vst2.cpp`, but since
|
||||||
// `plugin/plugin.cpp`, but since the plugin will probably call the host
|
// the plugin will probably call the host callback while it's initializing
|
||||||
// callback while it's initializing we sadly have to use a global here.
|
// we sadly have to use a global here.
|
||||||
{
|
|
||||||
std::lock_guard lock(current_bridge_instance_mutex);
|
|
||||||
current_bridge_instance = this;
|
current_bridge_instance = this;
|
||||||
plugin = vst_entry_point(host_callback_proxy);
|
plugin = vst_entry_point(host_callback_proxy);
|
||||||
if (!plugin) {
|
if (!plugin) {
|
||||||
@@ -117,7 +110,6 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
|
|||||||
// We only needed this little hack during initialization
|
// We only needed this little hack during initialization
|
||||||
current_bridge_instance = nullptr;
|
current_bridge_instance = nullptr;
|
||||||
plugin->ptr1 = this;
|
plugin->ptr1 = this;
|
||||||
}
|
|
||||||
|
|
||||||
// Send the plugin's information to the Linux VST plugin. Any other updates
|
// Send the plugin's information to the Linux VST plugin. Any other updates
|
||||||
// of this object will be sent over the `dispatcher()` socket. This would be
|
// of this object will be sent over the `dispatcher()` socket. This would be
|
||||||
|
|||||||
Reference in New Issue
Block a user