add an unlock() method to Synchronized<T>::LockedPtr
Summary:
Add an unlock() method to Synchronized LockedPtr objects. This will make it
easier to replace current users of the UNSYNCHRONIZED macro.
Of the handful of places currently using UNSYNCHRONIZED, many of them want to
simply release the lock before logging a message and returning. However,
UNSYNCHRONIZED is a poor choice for this, since it will re-acquire the lock on
scope exit. In these situations where the function returns from inside an
UNSYNCHRONIZED block the code unnecessarily re-acquires the lock just to
immediately release it. The unlock() method will provide a cleaner mechanism
for these call sites to simply drop the lock early before returning.
Reviewed By: yfeldblum
Differential Revision:
D3547652
fbshipit-source-id:
4d28fe9f3aad0d7348e918d1a3d6c705bfec242b