From 684701427e24ff3ecc9fca9a15c12434a19856b6 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Wed, 26 Aug 2015 21:42:05 +1000 Subject: [PATCH] Rename variables in PortaudioBackend in preparation for using PA callback API --- libs/backends/portaudio/portaudio_backend.cc | 12 ++++++------ libs/backends/portaudio/portaudio_backend.h | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libs/backends/portaudio/portaudio_backend.cc b/libs/backends/portaudio/portaudio_backend.cc index 420a45aae5..c91cff2b86 100644 --- a/libs/backends/portaudio/portaudio_backend.cc +++ b/libs/backends/portaudio/portaudio_backend.cc @@ -428,7 +428,7 @@ PortAudioBackend::midi_option () const static void * pthread_process (void *arg) { PortAudioBackend *d = static_cast(arg); - d->main_process_thread (); + d->main_blocking_process_thread (); pthread_exit (0); return 0; } @@ -556,9 +556,9 @@ bool PortAudioBackend::start_blocking_process_thread () { if (_realtime_pthread_create (SCHED_FIFO, -20, 100000, - &_main_thread, pthread_process, this)) + &_main_blocking_thread, pthread_process, this)) { - if (pthread_create (&_main_thread, NULL, pthread_process, this)) + if (pthread_create (&_main_blocking_thread, NULL, pthread_process, this)) { DEBUG_AUDIO("Failed to create main audio thread\n"); _run = false; @@ -587,7 +587,7 @@ PortAudioBackend::stop_blocking_process_thread () { void *status; - if (pthread_join (_main_thread, &status)) { + if (pthread_join (_main_blocking_thread, &status)) { DEBUG_AUDIO("Failed to stop main audio thread\n"); return false; } @@ -759,7 +759,7 @@ PortAudioBackend::join_process_threads () bool PortAudioBackend::in_process_thread () { - if (pthread_equal (_main_thread, pthread_self()) != 0) { + if (pthread_equal (_main_blocking_thread, pthread_self()) != 0) { return true; } @@ -1399,7 +1399,7 @@ PortAudioBackend::get_buffer (PortEngine::PortHandle port, pframes_t nframes) void * -PortAudioBackend::main_process_thread () +PortAudioBackend::main_blocking_process_thread () { AudioEngine::thread_init_callback (this); _active = true; diff --git a/libs/backends/portaudio/portaudio_backend.h b/libs/backends/portaudio/portaudio_backend.h index f1f607e0df..498a3d9944 100644 --- a/libs/backends/portaudio/portaudio_backend.h +++ b/libs/backends/portaudio/portaudio_backend.h @@ -317,7 +317,7 @@ class PortAudioBackend : public AudioBackend { void* get_buffer (PortHandle, pframes_t); - void* main_process_thread (); + void* main_blocking_process_thread (); private: // Methods bool start_blocking_process_thread (); @@ -367,7 +367,9 @@ class PortAudioBackend : public AudioBackend { /* processing */ float _dsp_load; framecnt_t _processed_samples; - pthread_t _main_thread; + + /* blocking thread */ + pthread_t _main_blocking_thread; /* process threads */ static void* portaudio_process_thread (void *);