diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-11-10 22:50:52 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-11-10 22:50:52 +0000 |
commit | ab399143a613f259e55885e4f048c94c0c51c906 (patch) | |
tree | f80475e533d4677366dd27cc17525e2b36da114e /libs/ardour/graph.cc | |
parent | 2a00515a78fa3ca98bea8ec1ea649a654c00ee2d (diff) |
fix dubious conflation of int and pthread_t
git-svn-id: svn://localhost/ardour2/branches/3.0@7998 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/graph.cc')
-rw-r--r-- | libs/ardour/graph.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc index 0987b979a2..6dc76673ff 100644 --- a/libs/ardour/graph.cc +++ b/libs/ardour/graph.cc @@ -82,10 +82,15 @@ Graph::Graph (Session & session) info << string_compose (_("Using %2 threads on %1 CPUs"), num_cpu, num_threads) << endmsg; - _thread_list.push_back (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this), 100000)); + pthread_t a_thread; + + if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this), &a_thread, 100000) == 0) { + _thread_list.push_back (a_thread); + } for (int i = 1; i < num_threads; ++i) { - _thread_list.push_back (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this), 100000)); + if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this), &a_thread, 100000)); + _thread_list.push_back (a_thread); } } @@ -317,7 +322,10 @@ Graph::run_one() to_run = 0; } - int wakeup = min ((int) _execution_tokens, (int) _trigger_queue.size()); + int et = _execution_tokens; + int ts = _trigger_queue.size(); + + int wakeup = min (et, ts); _execution_tokens -= wakeup; for (int i=0; i<wakeup; i++ ) { |