Base class holding the lock byte and the bit‐packing helpers shared by every MicroLock specialization.
Synopsis
Declared in <folly/MicroLock.h>
class MicroLockCore;
Member Functions
Name |
Description |
Loads the data stored in the unused bits of the lock atomically. |
|
Stores the data in the unused bits of the lock atomically. Since 2 bits are used by the lock, the most significant 2 bits of the provided value will be ignored. |
|
Release the lock without modifying the stored data bits. |
|
Unlocks the lock and stores the bits of the provided value into the data bits. Since 2 bits are used by the lock, the most significant 2 bits of the provided value will be ignored. |
Protected Member Functions
Name |
Description |
Mask for bit indicating that the flag is held. |
|
Acquire the lock along the contended path, spinning then yielding. |
|
Unlock the lock, applying a modifier to compute the stored word. |
|
Mask for bit indicating that there is a waiter that should be woken up. |
Protected Static Member Functions
Name |
Description |
Decodes the value stored in the unused bits of the lock. |
|
Decode the user data stored in the data bits of a lock word. |
|
Encodes the value for the unused bits of the lock. |
|
Encode user data into the data bits of a lock word, preserving lock bits. |
Protected Data Members
Name |
Description |
The single byte holding both the lock bits and the packed data bits. |
Protected Static Data Members
Name |
Description |
Mask selecting the bits available for user data. |
|
Mask selecting the bits reserved for lock state. |
|
Number of low bits reserved for lock state. |
Derived Classes
Name |
Description |
A tiny one‐byte spinlock with a configurable spin and yield budget. |
Created with MrDocs