Boost logo

Boost Users :

Subject: Re: [Boost-users] Good lock_guard<mytype> example
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-04-01 19:22:16


AMDG

On 04/01/2013 04:12 PM, Michael Powell wrote:
> Hello,
>
> The pattern goes something like this: boost::lock_guard<mytype>
> guard(*this).
>
> However, compiler is asking for a lock or unlock. I don't know what this
> is, or what it should be.
>

You can't lock an arbitrary object. You can only
lock a mutex. If you really want to make an object
act like a mutex, see
http://www.boost.org/doc/libs/1_53_0/doc/html/thread/synchronization.html#thread.synchronization.mutex_concepts.basic_lockable

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net