diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 14a1041cba..655ba7d53d 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1377,7 +1377,7 @@ Route::clear_processors (Placement p) } int -Route::remove_processor (boost::shared_ptr processor, ProcessorStreams* err, bool) +Route::remove_processor (boost::shared_ptr processor, ProcessorStreams* err, bool need_process_lock) { // TODO once the export point can be configured properly, do something smarter here if (processor == _capturing_processor) { @@ -1397,7 +1397,10 @@ Route::remove_processor (boost::shared_ptr processor, ProcessorStream processor_max_streams.reset(); { - Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ()); + Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock (), Glib::Threads::NOT_LOCK); + if (need_process_lock) { + lx.acquire(); + } Glib::Threads::RWLock::WriterLock lm (_processor_lock); ProcessorState pstate (this); @@ -1457,6 +1460,9 @@ Route::remove_processor (boost::shared_ptr processor, ProcessorStream } } } + if (need_process_lock) { + lx.release(); + } } reset_instrument_info (); @@ -4152,8 +4158,7 @@ Route::has_external_redirects () const boost::shared_ptr Route::the_instrument () const { - Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ()); - Glib::Threads::RWLock::WriterLock lm (_processor_lock); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); return the_instrument_unlocked (); }