proxygen
|
#include <LockTraits.h>
Static Public Member Functions | |
template<typename Mutex > | |
static void | unlock (Mutex &mutex) |
Unlock helpers
These help in determining whether it is safe for Synchronized::LockedPtr instances to be move assigned from one another. It is safe if they both have the same unlock policy, and it is not if they don't have the same unlock policy. For example
auto wlock = synchronized.wlock(); wlock.unlock();
wlock = synchronized.rlock();
This code would try to release the shared lock with a call to unlock(), resulting in possibly undefined behavior. By allowing the LockPolicy classes (defined below) to know what their unlocking behavior is, we can prevent against this by disabling unsafe conversions to and from incompatible LockedPtr types (they are incompatible if the underlying LockPolicy has different unlock policies.
Definition at line 372 of file LockTraits.h.
|
inlinestatic |