diff options
Diffstat (limited to 'gr-audio/lib/osx')
-rw-r--r-- | gr-audio/lib/osx/circular_buffer.h | 24 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_sink.cc | 8 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_sink.h | 4 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_source.cc | 8 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_source.h | 4 |
5 files changed, 24 insertions, 24 deletions
diff --git a/gr-audio/lib/osx/circular_buffer.h b/gr-audio/lib/osx/circular_buffer.h index 65788d482c..7abbeaeb0c 100644 --- a/gr-audio/lib/osx/circular_buffer.h +++ b/gr-audio/lib/osx/circular_buffer.h @@ -23,7 +23,7 @@ #ifndef _CIRCULAR_BUFFER_H_ #define _CIRCULAR_BUFFER_H_ -#include <gruel/thread.h> +#include <thread/thread.h> #include <iostream> #include <stdexcept> @@ -49,9 +49,9 @@ private: size_t d_n_avail_write_I, d_n_avail_read_I; // stuff to control access to class internals - gruel::mutex* d_internal; - gruel::condition_variable* d_readBlock; - gruel::condition_variable* d_writeBlock; + gr::thread::mutex* d_internal; + gr::thread::condition_variable* d_readBlock; + gr::thread::condition_variable* d_writeBlock; // booleans to decide how to control reading, writing, and aborting bool d_doWriteBlock, d_doFullRead, d_doAbort; @@ -96,13 +96,13 @@ public: }; inline size_t n_avail_write_items () { - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); size_t retVal = d_n_avail_write_I; return (retVal); }; inline size_t n_avail_read_items () { - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); size_t retVal = d_n_avail_read_I; return (retVal); }; @@ -120,13 +120,13 @@ public: // create a mutex to handle contention of shared resources; // any routine needed access to shared resources uses lock() // before doing anything, then unlock() when finished. - d_internal = new gruel::mutex (); + d_internal = new gr::thread::mutex (); // link the internal mutex to the read and write conditions; // when wait() is called, the internal mutex will automatically // be unlock()'ed. Upon return (from a notify_one() to the condition), // the internal mutex will be lock()'ed. - d_readBlock = new gruel::condition_variable (); - d_writeBlock = new gruel::condition_variable (); + d_readBlock = new gr::thread::condition_variable (); + d_writeBlock = new gr::thread::condition_variable (); }; /* @@ -167,7 +167,7 @@ public: if (!buf) throw std::runtime_error ("circular_buffer::enqueue(): " "input buffer is NULL.\n"); - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); if (d_doAbort) { return (2); } @@ -253,7 +253,7 @@ public: throw std::runtime_error ("circular_buffer::dequeue()"); } - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); if (d_doAbort) { return (2); } @@ -305,7 +305,7 @@ public: }; void abort () { - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); d_doAbort = true; d_writeBlock->notify_one (); d_readBlock->notify_one (); diff --git a/gr-audio/lib/osx/osx_sink.cc b/gr-audio/lib/osx/osx_sink.cc index ace96ec742..b7fe4e9d11 100644 --- a/gr-audio/lib/osx/osx_sink.cc +++ b/gr-audio/lib/osx/osx_sink.cc @@ -188,12 +188,12 @@ namespace gr { // create the stuff to regulate I/O - d_cond_data = new gruel::condition_variable(); + d_cond_data = new gr::thread::condition_variable(); if(d_cond_data == NULL) CheckErrorAndThrow(errno, "new condition (data)", "audio_osx_sink::audio_osx_sink"); - d_internal = new gruel::mutex(); + d_internal = new gr::thread::mutex(); if(d_internal == NULL) CheckErrorAndThrow(errno, "new mutex (internal)", "audio_osx_sink::audio_osx_sink"); @@ -288,7 +288,7 @@ namespace gr { gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - gruel::scoped_lock l(*d_internal); + gr::thread::scoped_lock l(*d_internal); /* take the input data, copy it, and push it to the bottom of the queue mono input are pushed onto queue[0]; @@ -386,7 +386,7 @@ namespace gr { osx_sink* This = (osx_sink*)inRefCon; OSStatus err = noErr; - gruel::scoped_lock l(*This->d_internal); + gr::thread::scoped_lock l(*This->d_internal); #if _OSX_AU_DEBUG_ std::cerr << "cb_in: SC = " << This->d_queueSampleCount diff --git a/gr-audio/lib/osx/osx_sink.h b/gr-audio/lib/osx/osx_sink.h index 6bbd882239..153d2d76e6 100644 --- a/gr-audio/lib/osx/osx_sink.h +++ b/gr-audio/lib/osx/osx_sink.h @@ -47,8 +47,8 @@ namespace gr { UInt32 d_n_channels; UInt32 d_queueSampleCount, d_max_sample_count; bool d_do_block; - gruel::mutex* d_internal; - gruel::condition_variable* d_cond_data; + gr::thread::mutex* d_internal; + gr::thread::condition_variable* d_cond_data; circular_buffer<float>** d_buffers; // AudioUnits and Such diff --git a/gr-audio/lib/osx/osx_source.cc b/gr-audio/lib/osx/osx_source.cc index c79a6ec6e9..c666bb7ad8 100644 --- a/gr-audio/lib/osx/osx_source.cc +++ b/gr-audio/lib/osx/osx_source.cc @@ -484,12 +484,12 @@ namespace gr { // create the stuff to regulate I/O - d_cond_data = new gruel::condition_variable(); + d_cond_data = new gr::thread::condition_variable(); if(d_cond_data == NULL) CheckErrorAndThrow(errno, "new condition (data)", "audio_osx_source::audio_osx_source"); - d_internal = new gruel::mutex(); + d_internal = new gr::thread::mutex(); if(d_internal == NULL) CheckErrorAndThrow(errno, "new mutex (internal)", "audio_osx_source::audio_osx_source"); @@ -687,7 +687,7 @@ namespace gr { gr_vector_void_star &output_items) { // acquire control to do processing here only - gruel::scoped_lock l(*d_internal); + gr::thread::scoped_lock l(*d_internal); #if _OSX_AU_DEBUG_ std::cerr << "work1: SC = " << d_queueSampleCount @@ -806,7 +806,7 @@ namespace gr { OSStatus err = noErr; osx_source* This = static_cast<osx_source*>(inRefCon); - gruel::scoped_lock l(*This->d_internal); + gr::thread::scoped_lock l(*This->d_internal); #if _OSX_AU_DEBUG_ std::cerr << "cb0: in#F = " << inNumberFrames diff --git a/gr-audio/lib/osx/osx_source.h b/gr-audio/lib/osx/osx_source.h index 9315c8e44e..03a2d8879c 100644 --- a/gr-audio/lib/osx/osx_source.h +++ b/gr-audio/lib/osx/osx_source.h @@ -53,8 +53,8 @@ namespace gr { UInt32 d_n_AvailableInputFrames, d_n_ActualInputFrames; UInt32 d_n_user_channels, d_n_max_channels, d_n_deviceChannels; bool d_do_block, d_passThrough, d_waiting_for_data; - gruel::mutex* d_internal; - gruel::condition_variable* d_cond_data; + gr::thread::mutex* d_internal; + gr::thread::condition_variable* d_cond_data; circular_buffer<float>** d_buffers; // AudioUnits and Such |