summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnuradio-core/src/lib/gengen/gr_fastnoise_source_X.h.t2
-rw-r--r--gnuradio-core/src/lib/io/gr_file_source.cc10
-rw-r--r--gr-blocks/lib/file_source_impl.cc8
-rw-r--r--gruel/src/include/gruel/thread.h2
4 files changed, 12 insertions, 10 deletions
diff --git a/gnuradio-core/src/lib/gengen/gr_fastnoise_source_X.h.t b/gnuradio-core/src/lib/gengen/gr_fastnoise_source_X.h.t
index fab3e776f..007e44975 100644
--- a/gnuradio-core/src/lib/gengen/gr_fastnoise_source_X.h.t
+++ b/gnuradio-core/src/lib/gengen/gr_fastnoise_source_X.h.t
@@ -39,6 +39,7 @@ typedef boost::shared_ptr<@NAME@> @NAME@_sptr;
* \param ampl a scaling factor for the output
* \param seed seed for random generators. Note that for uniform and
* Gaussian distributions, this should be a negative number.
+ * \param samples number of samples to pre-generate.
*/
GR_CORE_API @NAME@_sptr
gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed = 0, long samples=1024*16);
@@ -55,6 +56,7 @@ gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed = 0, long sampl
* \param ampl a scaling factor for the output
* \param seed seed for random generators. Note that for uniform and
* Gaussian distributions, this should be a negative number.
+ * \param samples number of samples to pre-generate.
*/
class GR_CORE_API @NAME@ : public gr_sync_block {
friend GR_CORE_API @NAME@_sptr
diff --git a/gnuradio-core/src/lib/io/gr_file_source.cc b/gnuradio-core/src/lib/io/gr_file_source.cc
index 09f3986cd..f3def0721 100644
--- a/gnuradio-core/src/lib/io/gr_file_source.cc
+++ b/gnuradio-core/src/lib/io/gr_file_source.cc
@@ -89,7 +89,7 @@ gr_file_source::work (int noutput_items,
if(d_fp == NULL)
throw std::runtime_error("work with file not open");
- boost::mutex::scoped_lock lock(fp_mutex); // hold for the rest of this function
+ gruel::scoped_lock lock(fp_mutex); // hold for the rest of this function
while (size) {
i = fread(o, d_itemsize, size, (FILE *) d_fp);
@@ -129,7 +129,7 @@ bool
gr_file_source::seek (long seek_point, int whence)
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
return fseek((FILE *) d_fp, seek_point * d_itemsize, whence) == 0;
}
@@ -137,7 +137,7 @@ void
gr_file_source::open(const char *filename, bool repeat)
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
int fd;
@@ -166,7 +166,7 @@ void
gr_file_source::close()
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
if(d_new_fp != NULL) {
fclose(d_new_fp);
@@ -179,7 +179,7 @@ void
gr_file_source::do_update()
{
if(d_updated) {
- boost::mutex::scoped_lock lock(fp_mutex); // hold while in scope
+ gruel::scoped_lock lock(fp_mutex); // hold while in scope
if(d_fp)
fclose(d_fp);
diff --git a/gr-blocks/lib/file_source_impl.cc b/gr-blocks/lib/file_source_impl.cc
index ed1f50c43..a8db31be7 100644
--- a/gr-blocks/lib/file_source_impl.cc
+++ b/gr-blocks/lib/file_source_impl.cc
@@ -84,7 +84,7 @@ namespace gr {
file_source_impl::open(const char *filename, bool repeat)
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
int fd;
@@ -113,7 +113,7 @@ namespace gr {
file_source_impl::close()
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
if(d_new_fp != NULL) {
fclose(d_new_fp);
@@ -126,7 +126,7 @@ namespace gr {
file_source_impl::do_update()
{
if(d_updated) {
- boost::mutex::scoped_lock lock(fp_mutex); // hold while in scope
+ gruel::scoped_lock lock(fp_mutex); // hold while in scope
if(d_fp)
fclose(d_fp);
@@ -150,7 +150,7 @@ namespace gr {
if(d_fp == NULL)
throw std::runtime_error("work with file not open");
- boost::mutex::scoped_lock lock(fp_mutex); // hold for the rest of this function
+ gruel::scoped_lock lock(fp_mutex); // hold for the rest of this function
while(size) {
i = fread(o, d_itemsize, size, (FILE*)d_fp);
diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h
index 2172e90d3..60832675c 100644
--- a/gruel/src/include/gruel/thread.h
+++ b/gruel/src/include/gruel/thread.h
@@ -42,7 +42,7 @@ namespace gruel {
typedef boost::thread thread;
typedef boost::mutex mutex;
- typedef boost::mutex::scoped_lock scoped_lock;
+ typedef boost::unique_lock<boost::mutex> scoped_lock;
typedef boost::condition_variable condition_variable;
/*! \brief a system-dependent typedef for the underlying thread type.