|
Threads-Devel : |
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-04-14 10:09:07
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 14 April 2008 03:40 am, Anthony Williams wrote:
> sides, as you point out. This only happens if you start with an
> upgrade_lock on A, since otherwise you have to unlock the shared lock
> before you can take the unique lock, and taking an upgrade lock should
I don't think that is true, since you can smoothly transition from a
shared_lock to an upgrade_lock. It's true upgrade_lock doesn't support
moving a shared_lock into an upgrade lock, but you can transition from a
shared to upgrade lock by doing:
mutex_type m;
shared_lock<mutex_type> shared(m);
upgrade_lock<mutex_type> upgrade(m);
shared.unlock();
- --
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIA2WE5vihyNWuA4URAnoZAKDH1iKp+ZE3Pod4njD3ZI1McGLNPQCfaC8M
Xap1foReZuku36JTt/VkS0E=
=6Tjy
-----END PGP SIGNATURE-----