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 | |
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')
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 2 | ||||
-rw-r--r-- | libs/ardour/audioengine.cc | 9 | ||||
-rw-r--r-- | libs/ardour/graph.cc | 14 |
3 files changed, 16 insertions, 9 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 0226e23282..7060e68331 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -240,7 +240,7 @@ _ the regular process() call to session->process() is not made. static AudioEngine* instance() { return _instance; } void died (); - pthread_t create_process_thread (boost::function<void()>, size_t stacksize); + int create_process_thread (boost::function<void()>, pthread_t*, size_t stacksize); private: static AudioEngine* _instance; diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 7a3c279705..5f619d8392 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -1477,19 +1477,18 @@ AudioEngine::is_realtime () const return jack_is_realtime (_priv_jack); } -pthread_t -AudioEngine::create_process_thread (boost::function<void()> f, size_t stacksize) +int +AudioEngine::create_process_thread (boost::function<void()> f, pthread_t* thread, size_t stacksize) { GET_PRIVATE_JACK_POINTER_RET (_jack, 0); - pthread_t thread; ThreadData* td = new ThreadData (this, f, stacksize); - if (jack_client_create_thread (_priv_jack, &thread, jack_client_real_time_priority (_priv_jack), + if (jack_client_create_thread (_priv_jack, thread, jack_client_real_time_priority (_priv_jack), jack_is_realtime (_priv_jack), _start_process_thread, td)) { return -1; } - return thread; + return 0; } void* 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++ ) { |