Comment a few things and add missing process lock when adding a route from a template.
authorCarl Hetherington <carl@carlh.net>
Sat, 11 Dec 2010 00:23:51 +0000 (00:23 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 11 Dec 2010 00:23:51 +0000 (00:23 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8242 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/io.h
libs/ardour/io.cc
libs/ardour/route.cc
libs/ardour/session.cc

index fd7cb563fd725f1745d4b939ca9cb74b5225abe0..94dbfadb04983f7293a349c3435630bc82336721 100644 (file)
@@ -133,8 +133,11 @@ class IO : public SessionObject, public Latent
 
        const ChanCount& n_ports ()  const { return _ports.count(); }
 
-       /** Emitted with the process lock held */
-       PBD::Signal2<void,IOChange,void*> changed;
+       /* The process lock will be held on emission of this signal if
+        * IOChange contains ConfigurationChanged.  In other cases,
+        * the process lock status is undefined.
+        */
+       PBD::Signal2<void, IOChange, void *> changed;
 
        virtual XMLNode& state (bool full);
        XMLNode& get_state (void);
index c29ee51a5849b995165d067c23204a3c5884a23c..ced4508d7ac26316bc606eef3d77aa551841a2ae 100644 (file)
@@ -189,7 +189,6 @@ IO::disconnect (Port* our_port, string other_port, void* src)
        return 0;
 }
 
-/** Caller must hold process lock */
 int
 IO::connect (Port* our_port, string other_port, void* src)
 {
index 55b3a59f51cf8f5070fdb92ec751863bfb3def13..51ea1960cb96c1b386143ac974427f540cfb250c 100644 (file)
@@ -2718,7 +2718,7 @@ Route::nonrealtime_handle_transport_stopped (bool /*abort_ignored*/, bool did_lo
        _roll_delay = _initial_delay;
 }
 
-/** Called with the process lock held */
+/** Called with the process lock held if change contains ConfigurationChanged */
 void
 Route::input_change_handler (IOChange change, void * /*src*/)
 {
@@ -2729,7 +2729,7 @@ Route::input_change_handler (IOChange change, void * /*src*/)
        }
 }
 
-/** Called with the process lock held */
+/** Called with the process lock held if change contains ConfigurationChanged */
 void
 Route::output_change_handler (IOChange change, void * /*src*/)
 {
index 11fd1fc635508f33036a6e2e67a023996703dd03..c80f9c3e2e07c0450950cebb87d2cdf1bf5c8879 100644 (file)
@@ -1933,6 +1933,9 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
                                   picks up the configuration of the route. During session
                                   loading this normally happens in a different way.
                                */
+                               
+                               Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
+                               
                                IOChange change (IOChange::Type (IOChange::ConfigurationChanged | IOChange::ConnectionsChanged));
                                change.after = route->input()->n_ports();
                                route->input()->changed (change, this);