From 93e662348cac56ae7c8406d46714ea0198f6cdd9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 5 Nov 2011 17:54:44 +0000 Subject: A few more comments. git-svn-id: svn://localhost/ardour2/branches/3.0@10462 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/graphnode.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libs/ardour/graphnode.cc') diff --git a/libs/ardour/graphnode.cc b/libs/ardour/graphnode.cc index 72b64abae0..c8923a043d 100644 --- a/libs/ardour/graphnode.cc +++ b/libs/ardour/graphnode.cc @@ -36,14 +36,22 @@ GraphNode::~GraphNode() void GraphNode::prep (int chain) { + /* This is the number of nodes that directly feed us */ _refcount = _init_refcount[chain]; } +/** Called by another node to tell us that one of the nodes that feed us + * has been processed. + */ void GraphNode::dec_ref() { - if (g_atomic_int_dec_and_test (&_refcount)) + if (g_atomic_int_dec_and_test (&_refcount)) { + /* All the nodes that feed us are done, so we can queue this node + for processing. + */ _graph->trigger (this); + } } void @@ -52,6 +60,7 @@ GraphNode::finish (int chain) node_set_t::iterator i; bool feeds_somebody = false; + /* Tell the nodes that we feed that we've finished */ for (i=_activation_set[chain].begin(); i!=_activation_set[chain].end(); i++) { (*i)->dec_ref(); feeds_somebody = true; -- cgit v1.2.3