using a condition_variable with a scoped_try_lock

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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_lockboost::mutex’ is an inaccessible base of ‘boost::detail::try_lock_wrapperboost::mutex’ Does this mean I can't use a condition variable with a try lock? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJLZ3f9AAoJEO6BIH4o6iWz110IAKxqpv3zNQWp8KmJZtC4JqOu 07uh94q+TWLzVgdqENEFhO9h6M64crLyEcmLgvRLM7wSMYpL1FifyGVDmLcmZ1qR +nGCeOfwJEsqQlNNlp2GmAW44jABFRgY8eb15B1QYKYHe1uhaZxnLd6NZplHOWEZ fJZylFlobrUUDvYDZKntmIzgCpAefMkcWN6GX1Dgm2W9LJGnOkkDmFO7N645eYfN 02a8DkxjixHRz2nvfAu7VRX5ECpGweGCiZ05JSOIP1ymyVQNlyIJS5a+nzsDDAgg SDpbLSaHtdBFeVEkwHKgQcyvurrtqdkTOo/oaJzwExUDzDVNh7CwHFv0oeEXSeU= =JrhX -----END PGP SIGNATURE-----

Richard Connon
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_lockboost::mutex’ is an inaccessible base of ‘boost::detail::try_lock_wrapperboost::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_lockboost::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
participants (2)
-
Anthony Williams
-
Richard Connon