slightly more efficient implementation of Graph::in_process_thread()

git-svn-id: svn://localhost/ardour2/branches/3.0@11278 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2012-01-20 14:35:02 +00:00
parent facd8b2d90
commit 052a0785b5
2 changed files with 6 additions and 5 deletions

View File

@@ -35,6 +35,7 @@
#include "pbd/rcu.h"
#include "pbd/signals.h"
#include "pbd/stacktrace.h"
#include <jack/weakjack.h>
#include <jack/jack.h>

View File

@@ -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;
}