Boost logo

Boost Users :

Subject: Re: [Boost-users] [thread] lock(Iterator,Iterator) bug?
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2009-08-20 12:09:39


strasser_at_[hidden] writes:

> according to this point in the library documentation:
> http://www.boost.org/doc/libs/1_39_0/doc/html/thread/synchronization.html#thread.synchronization.lock_functions.lock_range
>
> there are, among others, these non-member functions on Boost.Thread:
>
> template<typename ForwardIterator>
> void lock(ForwardIterator begin,ForwardIterator end);
>
> template<typename Lockable1,typename Lockable2>
> void lock(Lockable1& l1,Lockable2& l2);
>
> this example:
>
> vector<mutex> vec;
> lock(vec.begin(),vec.end());
>
> fails on gcc 4.3.2, complaining that the vector iterator doesn`t have
> members named, lock(), unlock(), ...

This is a bug. It worked where I tested it, but my tests were
insufficiently extensive.

I believe there is a trac entry for this already.

Anthony

-- 
Author of C++ Concurrency in Action | http://www.manning.com/williams
just::thread C++0x thread library   | http://www.stdthread.co.uk
Just Software Solutions Ltd         | http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

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