proxygen
|
#include <LifoSem.h>
Public Member Functions | |
uint32_t | idx () const |
uint32_t | value () const |
constexpr bool | isNodeIdx () const |
constexpr bool | isShutdown () const |
constexpr bool | isLocked () const |
constexpr uint32_t | seq () const |
LifoSemHead | withPop (uint32_t idxNext) const |
LifoSemHead | withPush (uint32_t _idx) const |
Returns the LifoSemHead that results from pushing a new waiter node. More... | |
LifoSemHead | withValueIncr (uint32_t delta) const |
LifoSemHead | withValueDecr (uint32_t delta) const |
Returns the LifoSemHead that results from decrementing the value. More... | |
LifoSemHead | withShutdown () const |
LifoSemHead | withLock () const |
LifoSemHead | withoutLock (uint32_t idxNext) const |
constexpr bool | operator== (const LifoSemHead &rhs) const |
constexpr bool | operator!= (const LifoSemHead &rhs) const |
Static Public Member Functions | |
static constexpr LifoSemHead | fresh (uint32_t value) |
Public Attributes | |
uint64_t | bits |
Private Types | |
enum | { IsNodeIdxShift = 32, IsShutdownShift = 33, IsLockedShift = 34, SeqShift = 35 } |
enum | : uint64_t { IsNodeIdxMask = uint64_t(1) << IsNodeIdxShift, IsShutdownMask = uint64_t(1) << IsShutdownShift, IsLockedMask = uint64_t(1) << IsLockedShift, SeqIncr = uint64_t(1) << SeqShift, SeqMask = ~(SeqIncr - 1) } |
LifoSemHead is a 64-bit struct that holds a 32-bit value, some state bits, and a sequence number used to avoid ABA problems in the lock-free management of the LifoSem's wait lists. The value can either hold an integral semaphore value (if there are no waiters) or a node index (see IndexedMemPool) for the head of a list of wait nodes
|
private |
|
private |
Enumerator | |
---|---|
IsNodeIdxMask | |
IsShutdownMask | |
IsLockedMask | |
SeqIncr | |
SeqMask |
Definition at line 228 of file LifoSem.h.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the LifoSemHead that results from popping a waiter node, given the current waiter node's next ptr
Definition at line 273 of file LifoSem.h.
Referenced by withoutLock().
|
inline |
Returns the LifoSemHead that results from pushing a new waiter node.
Definition at line 288 of file LifoSem.h.
References folly::value().
|
inline |
Returns the LifoSemHead with the same state as the current node, but with the shutdown bit set
Definition at line 318 of file LifoSem.h.
|
inline |
Returns the LifoSemHead that results from decrementing the value.
Definition at line 310 of file LifoSem.h.
References folly::value().
|
inline |
Returns the LifoSemHead with value increased by delta, with saturation if the maximum value is reached
Definition at line 298 of file LifoSem.h.
References UNLIKELY.
uint64_t folly::detail::LifoSemHead::bits |
Definition at line 237 of file LifoSem.h.
Referenced by operator==().