diff options
author | Carl Hetherington <carl@carlh.net> | 2011-11-05 17:54:44 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-11-05 17:54:44 +0000 |
commit | 93e662348cac56ae7c8406d46714ea0198f6cdd9 (patch) | |
tree | d19b85343ad6492d93decacf04e554a704191d6a /libs/ardour/graphnode.cc | |
parent | 00155d8f1e8648b7a459b241119dfac38d27437d (diff) |
A few more comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@10462 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/graphnode.cc')
-rw-r--r-- | libs/ardour/graphnode.cc | 11 |
1 files changed, 10 insertions, 1 deletions
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; |