Boost logo

Boost :

Subject: [boost] interprocess locks and move semantics compile problem [SEC=UNCLASSIFIED]
From: Levy, Gabriel (Contractor) (Gabriel.Levy_at_[hidden])
Date: 2011-08-30 23:58:52


UNCLASSIFIED

Hi all,

 

I'm having a problem getting this trivial couple of statements compile
on VC9 SP1 (VS2008), specifically the "move" emulation.

The sanitised snippet looks like this:

 

 

using namespace boost::interprocess;

 

interprocess_upgradable_mutex mMtx;

sharable_lock<interprocess_upgradable_mutex> sherLock(mMtx);

upgradable_lock<interprocess_upgradable_mutex> upgLock(move(sherLock));

 

 

The error message I'm getting is (nothing more, nothing less):

 

1>d:\experimental\notificationcentre.cpp(632) : error C2664:
'boost::interprocess::upgradable_lock<UpgradableMutex>::upgradable_lock(
boost::interprocess::scoped_lock<Mutex> &)' : cannot convert parameter 1
from 'boost::interprocess::rv<T>' to
'boost::interprocess::scoped_lock<Mutex> &'

1> with

1> [

1>
UpgradableMutex=boost::interprocess::interprocess_upgradable_mutex,

1> Mutex=boost::interprocess::interprocess_upgradable_mutex

1> ]

1> and

1> [

1>
T=boost::interprocess::sharable_lock<boost::interprocess::interprocess_u
pgradable_mutex>

1> ]

1> and

1> [

1> Mutex=boost::interprocess::interprocess_upgradable_mutex

1> ]

 

 

Strangely the compiler thinks that the best fit for the constructor
overload (with the "move") is the one with "scoped_lock" parameter type
instead of the "sharable_lock" version of it.

 

The same is the problem combining lock's move across the other types (up
or down grading the type of lock)

 

I must be missing something since I can't see anyone else experiencing
this problem.

Could anyone advise and shad some light as to why the "move" doesn't
work for me on the original interprocess locks?

 

Thanks in advance for any help.

 

Gabe

Gabe Levy
Senior Software Engineer, HiQ Systems Pty Ltd

 

IMPORTANT: This email remains the property of the Department of Defence
and is subject to the jurisdiction of section 70 of the Crimes Act 1914.
If you have received this email in error, you are requested to contact
the sender and delete the email.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk