summaryrefslogtreecommitdiff
path: root/libs/ardour/graph.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-01-14 22:02:26 +0000
committerCarl Hetherington <carl@carlh.net>2012-01-14 22:02:26 +0000
commitd4bab8aeed61d7de331d5fb10230de78edfd423b (patch)
treebdcafef0967ec81a1861f6094cebfd33a7ece13e /libs/ardour/graph.cc
parent6f795668b9693427cca817ef137252aad1aac509 (diff)
Trim some lock / unlock cycles on the trigger mutex.
git-svn-id: svn://localhost/ardour2/branches/3.0@11245 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/graph.cc')
-rw-r--r--libs/ardour/graph.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc
index 1c1f784f41..99fc524534 100644
--- a/libs/ardour/graph.cc
+++ b/libs/ardour/graph.cc
@@ -222,17 +222,18 @@ Graph::prep()
_finished_refcount = _init_finished_refcount[chain];
/* Trigger the initial nodes for processing, which are the ones at the `input' end */
+ pthread_mutex_lock (&_trigger_mutex);
for (i=_init_trigger_list[chain].begin(); i!=_init_trigger_list[chain].end(); i++) {
- trigger (i->get ());
+ /* don't use ::trigger here, as we have already locked the mutex */
+ _trigger_queue.push_back (i->get ());
}
+ pthread_mutex_unlock (&_trigger_mutex);
}
void
Graph::trigger (GraphNode* n)
{
- pthread_mutex_lock (&_trigger_mutex);
_trigger_queue.push_back (n);
- pthread_mutex_unlock (&_trigger_mutex);
}
/** Called when a node at the `output' end of the chain (ie one that has no-one to feed)