Boost logo

Boost :

Subject: Re: [boost] [interprocess] Assign to shared_lock from scoped_lock
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-04-08 10:26:46

Chard wrote:
> If I have (template args removed for brevity):
> shared_lock sh_lock(mutex);
> scoped_lock sc_lock(move(sh_lock), try_to_lock); // Try for exclusive
> if (sc_lock)
> {
> ...
> sh_lock = move(sc_lock); // Drop back to shared *** not available
> }
> Should that assignment operator be available?

All locks just implement move-assignment from it's own type. Exclusive
-> sharable is guaranteed to succeed so it might be added. The same
would happen with scoped->upgradable and upgradable->sharable. I'll add
it to my to do list.



Boost list run by bdawes at, gregod at, cpdaniel at, john at