Add back const write lock methods to Synchronized
Summary: The behavior of not allowing write locks on const methods is inconsistent, as there is no way of determining the semantics of the protected object. In particular there are two types of classes that come into mind here - Pointer and reference like classes. These can be const, but the underlying data item need not be const. Here it should be perfectly resaonable to allow users to acquire a write lock on a const Synchronized<> object - Types with mutable members. These can be write locked even when const, this behavior is probably okay. On the other hand the previous motivation of this diff - inconsistency with upgrade locks is being removed. They will no longer expose non-const access Reviewed By: yfeldblum Differential Revision: D13478631 fbshipit-source-id: 652a08c61abf35c3eadc45cedc5d300fbef83a6b
Showing
Please register or sign in to comment