From 70904eb3086578ac44167a90621108fa98a01e78 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <trondeau@vt.edu>
Date: Tue, 26 Feb 2013 13:14:39 -0500
Subject: analog: adding mutex locking when updating the fastnoise source
 parameters.

---
 gr-analog/lib/fastnoise_source_X_impl.cc.t | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

(limited to 'gr-analog/lib/fastnoise_source_X_impl.cc.t')

diff --git a/gr-analog/lib/fastnoise_source_X_impl.cc.t b/gr-analog/lib/fastnoise_source_X_impl.cc.t
index f33e7afa39..25ad8073aa 100644
--- a/gr-analog/lib/fastnoise_source_X_impl.cc.t
+++ b/gr-analog/lib/fastnoise_source_X_impl.cc.t
@@ -56,6 +56,22 @@ namespace gr {
     {
     }
 
+    void
+    @IMPL_NAME@::set_type(noise_type_t type)
+    {
+      gruel::scoped_lock l(d_setlock);
+      d_type = type;
+      generate();
+    }
+    
+    void
+    @IMPL_NAME@::set_amplitude(float ampl) 
+    {
+      gruel::scoped_lock l(d_setlock);
+      d_ampl = ampl;
+      generate();
+    }
+
     void
     @IMPL_NAME@::generate()
     {
@@ -107,6 +123,8 @@ namespace gr {
 		      gr_vector_const_void_star &input_items,
 		      gr_vector_void_star &output_items)
     {
+      gruel::scoped_lock l(d_setlock);
+
       @TYPE@ *out = (@TYPE@*)output_items[0];
 
       for(int i=0; i<noutput_items; i++) {
-- 
cgit v1.2.3