ThreadEntrySet is used to track all ThreadEntry that have a valid ElementWrapper for a particular TL id. The class provides no internal locking and caller must ensure safety of any access.

Synopsis

Declared in <folly/detail/ThreadLocalDetail.h>

struct ThreadEntrySet;

Types

Name

Description

Element

Pairs a thread entry with the dispose info cached for it.

Type Aliases

Name

Description

ElementVector

Vector of ThreadEntry for fast iteration during accessAllThreads.

EntryIndex

Map from ThreadEntry* to its slot in the threadElements vector to be able to remove an entry quickly.

Member Functions

Name

Description

basicSanity

Checks internal consistency of the set.

clear

Removes all tracked entries.

compress

compress

compressible

compressible

contains

Checks whether the given thread entry is tracked.

erase

Removes the given thread entry from the set.

getIndexFor

Returns the slot index of the given thread entry.

getPtrForThread

Helper function for debugging checks. Fetch ptr for a given ThreadEnrtry. Used to sanity check the value in ElementDisposeInfo wrapper matches the ElementWrapper array used for fast access from the thread itself.

insert

insert overloads

Data Members

Name

Description

entryToVectorSlot

Index from thread entry to its slot in threadElements.

threadElements

The tracked elements in insertion order.

Created with MrDocs