
6 Jul
2004
6 Jul
'04
1:03 p.m.
Michael Glassford wrote:
To me, it just feels like the wrong way to be notified that a lock promotion failed so you have to do something else--a try_promote() seems much better for this. However, if people really wanted a throwing promote(), I'd add it.
The point is that the scoped_write_lock wr( rd ); syntax, if supported, should never "succeed" without giving you a write lock. scoped_try_write_lock wr( rd ); can do that, but not scoped_write_lock. That said, can you show an example that demonstrates how a 'try_promote' can be used? I'm curious.