From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2007-11-27 09:09:59
-----BEGIN PGP SIGNED MESSAGE-----
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
> The new trunk code provides two condition variable types:
> condition_variable and condition_variable_any.
> condition_variable works with unique_lock<mutex> ONLY, and the function
> signatures are explicit about that. condition_variable_any will work with
> anything that supports unlock() and lock().
Ah, good to hear.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-----END PGP SIGNATURE-----
Content-Type: text/x-c++src; charset="iso-8859-1";
std::cout << "locked returns " << lock.locked() << std::endl;