summaryrefslogtreecommitdiff
path: root/libs/ardour/io.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-11-27 16:42:44 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-11-27 16:42:44 +0000
commit27cf00a5988345e177e1c57b133848754c1ae20d (patch)
treececd2a1e96d6073614fa73fb89f7b0ce548096d8 /libs/ardour/io.cc
parent30d64f31ac85cd2b999fce8709f05f9bcf127de6 (diff)
make IO::disconnect (port,port) symmetric with IO::connect (port,port) by requiring caller to hold process lock
git-svn-id: svn://localhost/ardour2/branches/3.0@8106 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/io.cc')
-rw-r--r--libs/ardour/io.cc47
1 files changed, 23 insertions, 24 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index de4d658596..0609726b23 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -159,34 +159,33 @@ IO::check_bundles (std::vector<UserBundleInfo*>& list, const PortSet& ports)
int
IO::disconnect (Port* our_port, string other_port, void* src)
{
+ assert (!AudioEngine::instance()->process_lock().trylock());
+
if (other_port.length() == 0 || our_port == 0) {
return 0;
}
- {
- BLOCK_PROCESS_CALLBACK ();
-
- {
- Glib::Mutex::Lock lm (io_lock);
-
- /* check that our_port is really one of ours */
-
- if ( ! _ports.contains(our_port)) {
- return -1;
- }
-
- /* disconnect it from the source */
-
- if (our_port->disconnect (other_port)) {
- error << string_compose(_("IO: cannot disconnect port %1 from %2"), our_port->name(), other_port) << endmsg;
- return -1;
- }
-
- check_bundles_connected ();
- }
-
- changed (IOChange (IOChange::ConnectionsChanged), src); /* EMIT SIGNAL */
- }
+
+ {
+ Glib::Mutex::Lock lm (io_lock);
+
+ /* check that our_port is really one of ours */
+
+ if ( ! _ports.contains(our_port)) {
+ return -1;
+ }
+
+ /* disconnect it from the source */
+
+ if (our_port->disconnect (other_port)) {
+ error << string_compose(_("IO: cannot disconnect port %1 from %2"), our_port->name(), other_port) << endmsg;
+ return -1;
+ }
+
+ check_bundles_connected ();
+ }
+
+ changed (IOChange (IOChange::ConnectionsChanged), src); /* EMIT SIGNAL */
_session.set_dirty ();