discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Thread Synchronization


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Thread Synchronization
Date: Tue, 12 May 2009 13:09:54 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, May 12, 2009 at 03:22:47PM -0400, Tom Lutz wrote:
> I'm editing some of the .cc files and would like to know the preferred
> method for performing thread synchronization in C++ code.  In particular, I
> noticed that the set and get methods that are called on the gr_oscope_guts
> class originate from a different thread then that of process_samples, and
> this is causing problems for me.
> 
> Thanks,
> Tom

Please use the boost mutexs:

  #include <boost/thread.hpp>

  boost::mutex  m;                      // the mutex
  
  boost::mutex::scoped_lock guard(m)    // the scoped guard

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]