On Wed, Oct 15, 2014 at 11:49 AM, Achilleas Anastasopoulos < anas...@umich.edu> wrote:
> My question arose from a comment that Jonathan made on one of the pull > requests > in gnuradio (#293). > > If we have a set function in a gr block that sets some private variable > that is > used in the work function, do we need to protect it to make the whole > operation thread safe? > > Is this a standard practice in gnuradio blocks? > eg, why is this not used in "add_const_vXX_impl.h.t" ? > > > thanks > Achilleas > If it's not atomic, then yes, you really should protect it. All blocks have a mutex called d_setlock you can easily use for this: gr::thread::scoped_lock lock(d_setlock); Tom
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio