A LockedPtr keeps a Synchronized<T> object locked for the duration of LockedPtr's existence.
Synopsis
Declared in <folly/Synchronized.h>
template<
class LockedType,
class LockPolicy>
class LockedPtr;
Description
It provides access the datum's members directly by using operator‐>() and operator*().
The LockPolicy parameter controls whether or not the lock is acquired in exclusive or shared mode.
Type Aliases
Name |
Description |
The type of the guarded datum. |
|
The underlying lock type held by this pointer. |
|
The type of the mutex guarding the datum. |
|
The non‐const |
Member Functions
Name |
Description |
|
Constructors |
|
Destructor releases. |
Assignment operators |
|
Locks that allow concurrent access (shared, upgrade) force const access with the standard accessors even if the Synchronized object is non‐const. |
|
|
|
Check if this LockedPtr is uninitialized, or points to valid locked data. |
|
Move the locked ptr from an upgrade state to a shared state. The current lock is left in a null state. |
|
* Upgrade lock methods. These are disabled via SFINAE when the mutex is not an upgrade mutex. |
|
Move the locked ptr from an exclusive state to a shared state. The current lock is left in a null state. |
|
Move the locked ptr from an exclusive state to an upgrade state. The current lock is left in a null state. |
|
Access the locked data. |
|
Access the locked data. |
|
Recover the parent |
|
Temporarily unlock the LockedPtr, and reset it to null. |
|
Release the lock and reset this pointer to null. |
|
Explicit boolean conversion. |
Friends
Name |
Description |
This class temporarily unlocks a LockedPtr in a scoped manner. |
|
|
A LockedPtr keeps a Synchronized<T> object locked for the duration of LockedPtr's existence. |
Created with MrDocs