diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-20 14:35:02 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-20 14:35:02 +0000 |
commit | 052a0785b5c2d2d90fc7d2eca1babe09aa526f14 (patch) | |
tree | 13982443e7c88e01446388209bcffe0bd0971225 | |
parent | facd8b2d90c74195cd4ac5c1ef7f877b78cefec9 (diff) |
slightly more efficient implementation of Graph::in_process_thread()
git-svn-id: svn://localhost/ardour2/branches/3.0@11278 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 1 | ||||
-rw-r--r-- | libs/ardour/graph.cc | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index a930d12e13..99b2508d8c 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -35,6 +35,7 @@ #include "pbd/rcu.h" #include "pbd/signals.h" +#include "pbd/stacktrace.h" #include <jack/weakjack.h> #include <jack/jack.h> diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc index 03ba4d969a..5b435884d4 100644 --- a/libs/ardour/graph.cc +++ b/libs/ardour/graph.cc @@ -597,10 +597,10 @@ Graph::process_one_route (Route* route) bool Graph::in_process_thread () const { - list<pthread_t>::const_iterator i = _thread_list.begin (); - while (i != _thread_list.end() && *i != pthread_self ()) { - ++i; + for (list<pthread_t>::const_iterator i = _thread_list.begin (); i != _thread_list.end(); ++i) { + if (*i == pthread_self()) { + return true; + } } - - return i != _thread_list.end (); + return false; } |