diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2013-10-02 19:40:48 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2013-10-04 18:53:37 +1000 |
commit | 53ad2d187ffb31edcb90f7db5799886ee1806586 (patch) | |
tree | 8974083bf0b95e5d4dfff9fe5e53d09641d685a3 /libs/ardour/graph.cc | |
parent | df363a4fb3057253c1530941176cac49a7ffd409 (diff) |
Move processing thread list from ARDOUR::Graph into AudioBackend implementation
Diffstat (limited to 'libs/ardour/graph.cc')
-rw-r--r-- | libs/ardour/graph.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc index 8b3d24031b..71eeee41ea 100644 --- a/libs/ardour/graph.cc +++ b/libs/ardour/graph.cc @@ -96,29 +96,24 @@ Graph::reset_thread_list () number of threads. */ - if (_thread_list.size() == num_threads) { + if (AudioEngine::instance()->process_thread_count() == num_threads) { return; } Glib::Threads::Mutex::Lock lm (_session.engine().process_lock()); - AudioBackendThread* backend_thread; - if (!_thread_list.empty()) { + if (AudioEngine::instance()->process_thread_count() != 0) { drop_threads (); } - if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this), backend_thread, 100000) != 0) { + if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this)) != 0) { throw failed_constructor (); } - _thread_list.push_back (backend_thread); - for (uint32_t i = 1; i < num_threads; ++i) { - if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this), backend_thread, 100000) != 0) { + if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this))) { throw failed_constructor (); } - - _thread_list.push_back (backend_thread); } } @@ -140,17 +135,15 @@ Graph::drop_threads () { _quit_threads = true; - for (unsigned int i=0; i< _thread_list.size(); i++) { + uint32_t thread_count = AudioEngine::instance()->process_thread_count (); + + for (unsigned int i=0; i < thread_count; i++) { _execution_sem.signal (); } _callback_start_sem.signal (); - for (list<AudioBackendThread*>::iterator i = _thread_list.begin(); i != _thread_list.end(); ++i) { - AudioEngine::instance()->join_process_thread (*i); - } - - _thread_list.clear (); + AudioEngine::instance()->join_process_threads (); _execution_tokens = 0; |