|
Boost Users : |
Subject: Re: [Boost-users] [interprocess] Meaning of "unspecified" arguments (scoped_lock constructors)
From: Mark Reginald James (mrj_at_[hidden])
Date: 2008-10-30 19:19:38
Steven Watanabe wrote:
> Mark Reginald James wrote:
>> I haven't been able to discover the meaning of "unspecified"
>> in things like scoped_lock constructor parameters:
>>
>> http://www.boost.org/doc/libs/1_36_0/doc/html/boost/interprocess/scoped_lock.html
>>
>> I'm trying to lock a scoped lock only if the mutex
>> is not null. It looks like I need to use one of these
>> "unspecified" constructors to assign the mutex but not lock
>> it, so that I can then lock it in an "if" statement if the mutex
>> is not null.
>
> The argument you want is boost::interprocess::defer_lock, I think.
>
> It look like the doxygen/boostbook needs some tweaking here.
Many thanks Steven. It looks like boost::interprocess::defer_lock
or boost::defer_lock was what I needed. This was in the "detail"
namespace at some stage, but that may now be obsolete.
Because the older version of the Boost library I am using
does not support scoped_lock with no constructor arguments,
instead of a deferred lock I had to use a smart_pointer to
an immediate lock, allowing the lock to be both conditionally
created and auto-released.
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