*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
// create the stuff to regulate I/O
- d_internal = new mld_mutex ();
- if (d_internal == NULL)
- CheckErrorAndThrow (errno, "new mld_mutex (internal)",
- "audio_osx_source::audio_osx_source");
-
d_cond_data = new mld_condition ();
if (d_cond_data == NULL)
CheckErrorAndThrow (errno, "new mld_condition (data)",
"audio_osx_source::audio_osx_source");
+ d_internal = d_cond_data->mutex ();
// initialize the AU for output
d_buffers = 0;
// close and delete control stuff
- delete d_internal;
delete d_cond_data;
}
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
- d_internal->wait ();
+ d_internal->lock ();
/* take the input data, copy it, and push it to the bottom of the queue
mono input are pushed onto queue[0];
if (d_do_block == true) {
// block until there is data to return
while (d_queueSampleCount > l_max_count) {
-// release control so-as to allow data to be retrieved
- d_internal->post ();
+// release control so-as to allow data to be retrieved;
// block until there is data to return
d_cond_data->wait ();
// the condition's signal() was called; acquire control
// to keep thread safe
- d_internal->wait ();
}
}
}
#endif
// release control to allow for other processing parts to run
- d_internal->post ();
+ d_internal->unlock ();
return (noutput_items);
}
audio_osx_sink* This = (audio_osx_sink*) inRefCon;
OSStatus err = noErr;
- This->d_internal->wait ();
+ This->d_internal->lock ();
#if _OSX_AU_DEBUG_
fprintf (stderr, "cb_in: SC = %4ld, in#F = %4ld\n",
This->d_cond_data->signal ();
// release control to allow for other processing parts to run
- This->d_internal->post ();
+ This->d_internal->unlock ();
return (err);
}