Boost logo

Threads-Devel :

From: Anthony Williams (anthony_at_[hidden])
Date: 2007-11-27 09:27:22


Frank Mori Hess <frank.hess_at_[hidden]> writes:

> On Tuesday 27 November 2007 03:06 am, Anthony Williams wrote:
>> > error: ‘class boost::unique_lock<boost::mutex>’ has no member named
>> > ‘locked’
>>
>> Where does that error come from? The condition variable code doesn't use a
>> locked() function, nor does unique_lock provide one.
>
> I've attached a small program that generates the error when I try to compile
> it. It's not actually related to conditions, all I have to do is try to use
> the locked() member of boost::mutex::scoped_lock (which is apparently a
> unique_lock). Maybe the docs just haven't been updated (the Lock concept
> still says it requires a locked() member function, and a cast to const
> void*).

I haven't checked in my updated docs as they're still unfinished, so the docs
are out of date.

The new code uses owns_lock() rather than locked() so it matches the C++0x
thread library proposals. Maybe I should add a locked() function for backwards
compatibility.

Anthony

-- 
Anthony Williams
Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk