Boost logo

Threads-Devel :

From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-04-08 11:12:08


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The backwards-compatibility typedef of scoped_try_lock to unique_lock in the
mutex classes doesn't look right. The old scoped_try_lock constructor with a
single argument:

try_mutex::scoped_try_lock(mutex)

is the equivalent of

unique_lock<try_mutex>(mutex, try_to_lock_t())

but old code will get mapped to the blocking single argument constructor of
unique_lock.

I think it would be better to either not have the typedef at all or to provide
a member class that really is backward compatible. There is also the smaller
issue that the old constructors that take a bool for the second argument are
not supported, although it seems they could be mapped onto the new
constructors trivially. Maybe have some scoped_lock wrapper classes that
publicly derive from unique_lock but have backward compatible constructors?

- --
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH+4ta5vihyNWuA4URAoj6AJ9jczIZEMe0uK/uzPckW2L0YzsmEgCeOEyk
WPv8r52i9uLsK3iL7WlAEuo=
=PVi4
-----END PGP SIGNATURE-----


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