fix all 4 backends' failure to include the main "backend" thread when computing ::in_process_thread()

This commit is contained in:
Paul Davis 2014-10-22 17:02:15 -04:00
parent aa0effb4cb
commit 68458cde69
6 changed files with 37 additions and 7 deletions

View file

@ -862,6 +862,16 @@ JACKAudioBackend::join_process_threads ()
bool
JACKAudioBackend::in_process_thread ()
{
#ifdef COMPILER_MINGW
if (_main_thread == GetCurrentThread()) {
return true;
}
#else // pthreads
if (pthread_equal (_main_thread, pthread_self()) != 0) {
return true;
}
#endif
for (std::vector<jack_native_thread_t>::const_iterator i = _jack_threads.begin ();
i != _jack_threads.end(); i++) {
@ -909,6 +919,8 @@ JACKAudioBackend::process_thread ()
/* JACK doesn't do this for us when we use the wait API
*/
_main_thread = pthread_self ();
AudioEngine::thread_init_callback (this);
while (1) {

View file

@ -209,6 +209,7 @@ class JACKAudioBackend : public AudioBackend {
std::map<DataType,size_t> _raw_buffer_sizes;
std::vector<jack_native_thread_t> _jack_threads;
jack_native_thread_t _main_thread;
static int _xrun_callback (void *arg);
static void* _process_thread (void *arg);