Boost logo

Boost Users :

Subject: Re: [Boost-users] using a condition_variable with a scoped_try_lock
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2010-02-02 03:00:18


Richard Connon <conan_at_[hidden]> writes:

> When I try to call wait() on a boost::condition variable with a
> boost::scoped_try_lock as the argument I get the following error...
>
> XXXXXXX.cpp:XX: error: ‘boost::unique_lock<boost::mutex>’ is an
> inaccessible base of ‘boost::detail::try_lock_wrapper<boost::mutex>’
>
> Does this mean I can't use a condition variable with a try lock?

It means you can't use it with
scoped_try_lock. boost::unique_lock<boost::mutex> provides try-lock
support, but the API is different to the old scoped_try_lock, so the
latter is provided for backwards compatibility.

Anthony

-- 
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
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