From 9e4b7a45fee81854d5dc395e3df6b3ba6cc570ac Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 16 Dec 2010 12:48:11 +0000 Subject: [PATCH] Fix deadlock. git-svn-id: svn://localhost/ardour2/branches/3.0@8286 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/port_insert.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc index b738c68de8..492fca2723 100644 --- a/libs/ardour/port_insert.cc +++ b/libs/ardour/port_insert.cc @@ -244,22 +244,20 @@ PortInsert::signal_latency() const } } -/** Caller must not hold process lock */ +/** Caller must hold process lock */ bool PortInsert::configure_io (ChanCount in, ChanCount out) { + assert (!AudioEngine::instance()->process_lock().trylock()); + /* for an insert, processor input corresponds to IO output, and vice versa */ - { - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); - - if (_input->ensure_io (in, false, this) != 0) { - return false; - } - - if (_output->ensure_io (out, false, this) != 0) { - return false; - } + if (_input->ensure_io (in, false, this) != 0) { + return false; + } + + if (_output->ensure_io (out, false, this) != 0) { + return false; } return Processor::configure_io (in, out);