discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Thread Synchronization


From: Tom Lutz
Subject: Re: [Discuss-gnuradio] Thread Synchronization
Date: Tue, 12 May 2009 16:38:08 -0400

On Tue, May 12, 2009 at 4:09 PM, Eric Blossom <address@hidden> wrote:
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

Thanks a bunch!
Tom

reply via email to

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