proxygen
folly::threadlocal_detail::ThreadEntryNode Struct Reference

#include <ThreadLocalDetail.h>

Public Member Functions

void initIfZero (bool locked)
 
void init (ThreadEntry *entry, uint32_t newId)
 
void initZero (ThreadEntry *entry, uint32_t newId)
 
FOLLY_ALWAYS_INLINE bool empty () const
 
FOLLY_ALWAYS_INLINE bool zero () const
 
FOLLY_ALWAYS_INLINE ThreadEntrygetThreadEntry ()
 
FOLLY_ALWAYS_INLINE ThreadEntryNodegetPrev ()
 
FOLLY_ALWAYS_INLINE ThreadEntryNodegetNext ()
 
void push_back (ThreadEntry *head)
 
void eraseZero ()
 

Public Attributes

uint32_t id
 
ThreadEntryparent
 
ThreadEntryprev
 
ThreadEntrynext
 

Detailed Description

Definition at line 73 of file ThreadLocalDetail.h.

Member Function Documentation

FOLLY_ALWAYS_INLINE bool folly::threadlocal_detail::ThreadEntryNode::empty ( ) const
inline

Definition at line 93 of file ThreadLocalDetail.h.

void folly::threadlocal_detail::ThreadEntryNode::eraseZero ( )

Definition at line 52 of file ThreadLocalDetail.cpp.

References folly::threadlocal_detail::ThreadEntry::elements, id, LIKELY, next, folly::threadlocal_detail::ElementWrapper::node, and prev.

52  {
53  if (LIKELY(prev != nullptr)) {
54  // get the prev and next nodes
55  ThreadEntryNode* nprev = &prev->elements[id].node;
56  ThreadEntryNode* nnext = &next->elements[id].node;
57 
58  // update the prev and next
59  nnext->prev = prev;
60  nprev->next = next;
61 
62  // set the prev and next to nullptr
63  next = prev = nullptr;
64  }
65 }
#define LIKELY(x)
Definition: Likely.h:47
void folly::threadlocal_detail::ThreadEntryNode::init ( ThreadEntry entry,
uint32_t  newId 
)
inline
void folly::threadlocal_detail::ThreadEntryNode::initIfZero ( bool  locked)
void folly::threadlocal_detail::ThreadEntryNode::initZero ( ThreadEntry entry,
uint32_t  newId 
)
inline
void folly::threadlocal_detail::ThreadEntryNode::push_back ( ThreadEntry head)

Definition at line 38 of file ThreadLocalDetail.cpp.

References folly::threadlocal_detail::ThreadEntry::elements, id, next, folly::threadlocal_detail::ElementWrapper::node, parent, and prev.

Referenced by folly::threadlocal_detail::StaticMetaBase::pushBackLocked(), and folly::threadlocal_detail::StaticMetaBase::pushBackUnlocked().

38  {
39  // get the head prev and next nodes
40  ThreadEntryNode* hnode = &head->elements[id].node;
41 
42  // update current
43  next = head;
44  prev = hnode->prev;
45 
46  // hprev
47  ThreadEntryNode* hprev = &hnode->prev->elements[id].node;
48  hprev->next = parent;
49  hnode->prev = parent;
50 }
FOLLY_ALWAYS_INLINE bool folly::threadlocal_detail::ThreadEntryNode::zero ( ) const
inline

Member Data Documentation

uint32_t folly::threadlocal_detail::ThreadEntryNode::id

Definition at line 74 of file ThreadLocalDetail.h.

Referenced by eraseZero(), and push_back().

ThreadEntry* folly::threadlocal_detail::ThreadEntryNode::next

Definition at line 77 of file ThreadLocalDetail.h.

Referenced by eraseZero(), initIfZero(), and push_back().

ThreadEntry* folly::threadlocal_detail::ThreadEntryNode::parent

Definition at line 75 of file ThreadLocalDetail.h.

Referenced by initIfZero(), and push_back().

ThreadEntry* folly::threadlocal_detail::ThreadEntryNode::prev

Definition at line 76 of file ThreadLocalDetail.h.

Referenced by eraseZero(), and push_back().


The documentation for this struct was generated from the following files: