folly::threadlocal_detail::ThreadEntry

Per-thread entry. Each thread using a StaticMeta object has one. This is written from the owning thread only (under the lock), read from the owning thread (no lock necessary), and read from other threads (under the lock).

Synopsis

Declared in <folly/detail/ThreadLocalDetail.h>

struct ThreadEntry;

Member Functions

NameDescription
cachedInSetMatchesElementsArray Checks that the cached set state matches the elements array for
cleanupElement Clean up element from ThreadEntry::elements at index
getElementsCapacity Returns the current capacity of the elements array.
releaseElement Releases element from ThreadEntry::elements at index
resetElement Resets the element at index
resetElementImplAfterSet Installs a prepared element wrapper at index
setElementsCapacity Sets the recorded capacity of the elements array.
tid Returns the std::thread::id of the owning thread.

Data Members

NameDescription
elements The per-thread array of element wrappers, indexed by entry id.
elementsCapacity The current capacity of the elements array.
list The list this entry belongs to.
listNext The next entry in the owning list.
meta The StaticMeta instance that owns this entry.
removed_ Whether this entry has been removed.
tid_data Storage for the std::thread::id of the owning thread.
tid_os The OS-level thread id.