Rename variables in PortaudioBackend in preparation for using PA callback API
authorTim Mayberry <mojofunk@gmail.com>
Wed, 26 Aug 2015 11:42:05 +0000 (21:42 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Wed, 2 Sep 2015 02:07:58 +0000 (12:07 +1000)
libs/backends/portaudio/portaudio_backend.cc
libs/backends/portaudio/portaudio_backend.h

index 420a45aae5928ebe7783bcf3771abf553be9c1bd..c91cff2b86f45c367def7cfe2e67f0a65955ceaf 100644 (file)
@@ -428,7 +428,7 @@ PortAudioBackend::midi_option () const
 static void * pthread_process (void *arg)
 {
        PortAudioBackend *d = static_cast<PortAudioBackend *>(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;
index f1f607e0df19cf015092de232160c50f6765a90f..498a3d99442353435e692c57b82d4e65ce378609 100644 (file)
@@ -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 *);