Fix deadlock.
authorCarl Hetherington <carl@carlh.net>
Thu, 16 Dec 2010 12:48:11 +0000 (12:48 +0000)
committerCarl Hetherington <carl@carlh.net>
Thu, 16 Dec 2010 12:48:11 +0000 (12:48 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8286 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/port_insert.cc

index b738c68de85177a54a5d8584b686d7dfb76f5f6a..492fca27237bd11a4cd7a0b1fbdf1397ed4ce98a 100644 (file)
@@ -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);