
8 Apr
2009
8 Apr
'09
2:26 p.m.
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. Best, Ion