On Thu, Jan 10, 2013 at 11:47 PM, Fredrik Orderud <forderud@gmail.com> wrote:
Attached is an updated patch that also updates the upgrade part. All boost::thread unit-tests still pass, and I think the changes makes shared_mutex easier to understand.

On first sight, it might appear like some of the upgrade-related methods becomes less efficient due to state_data members being modified several times redundantly (e.g. in try_unlock_shared_and_lock_upgrade), but that is something the compiler should be able to optimize away. Also, I might have introduced a slight change in behavior in unlock_upgrade_and_lock, due to state.upgrade now being reset before upgrade_cond.wait(lk) (as opposed to before), but my impression is that it shouldn't matter.

Please review the patch, and let me know if you have any questions.

Vicente,
have you had time to take a look at my updated patch yet?

If you're concerned about the size of the patch, then I would be more than happy to divide it up into smaller "bite-sized" change-sets that can be reviewed more easily.

Regards,
Fredrik