diff options
author | John Emmas <johne53@tiscali.co.uk> | 2013-10-06 11:56:03 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2013-10-06 11:56:03 +0100 |
commit | 300b484cf6ac14c15e365c4062345d64a61c4b18 (patch) | |
tree | f10b9abedc141192f5c35f9c0f40e94f1d52786d /libs/ardour/graph.cc | |
parent | 7d78172abfd9b02bcb6809db3f7545e90dbe968d (diff) | |
parent | 2d5e605bf124c82f77a5a893e540bc176164947d (diff) |
Merge branch 'master' into windows+cc
Conflicts (hopefully resolved):
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_options.cc
Diffstat (limited to 'libs/ardour/graph.cc')
-rw-r--r-- | libs/ardour/graph.cc | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc index 69c4953272..f8a1d51e10 100644 --- a/libs/ardour/graph.cc +++ b/libs/ardour/graph.cc @@ -97,29 +97,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()); - AudioBackendNativeThread a_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), &a_thread, 100000) != 0) { + if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this)) != 0) { throw failed_constructor (); } - _thread_list.push_back (a_thread); - for (uint32_t i = 1; i < num_threads; ++i) { - if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this), &a_thread, 100000) != 0) { + if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this))) { throw failed_constructor (); } - - _thread_list.push_back (a_thread); } } @@ -141,17 +136,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<AudioBackendNativeThread>::iterator i = _thread_list.begin(); i != _thread_list.end(); ++i) { - AudioEngine::instance()->wait_for_process_thread_exit (*i); - } - - _thread_list.clear (); + AudioEngine::instance()->join_process_threads (); _execution_tokens = 0; @@ -584,10 +577,5 @@ Graph::process_one_route (Route* route) bool Graph::in_process_thread () const { - for (list<AudioBackendNativeThread>::const_iterator i = _thread_list.begin (); i != _thread_list.end(); ++i) { - if (self_thread_equal (*i)) { - return true; - } - } - return false; + return AudioEngine::instance()->in_process_thread (); } |