I'd like to query the current state of an queuing_rw_mutex, basically to check if I'm currently dealing with an writer lock or an reader that I would need to upgrade.
For me this is usefull in situations where I would call an internal method which changes shared state. I would like to be able to call this method in situations where I already have an writer lock as well as in those where I only have an reader lock. The method therefore needs to have some means to decide if it needs to upgrade the passed lock or not. If I try to call upgrade_to_writer on an existing writer I will run into an assertion.
Are there any reservations from a design view as to adding some method to the scoped_lock f.ex. "bool scoped_lock::is_writer() const" ?