Represents an ID of a thread local object. Initially set to the maximum uint. This representation allows us to avoid a branch in accessing TLS data (because if you test capacity > id if id = maxint then the test will always fail). It allows us to keep a constexpr constructor and avoid SIOF.

Synopsis

Declared in <folly/detail/ThreadLocalDetail.h>

class EntryID;

Member Functions

Name

Description

EntryID [constructor]

Constructors

operator=

Assignment operators

getOrAllocate

Returns the current id, allocating one if needed.

getOrInvalid

Returns the current id without allocating.

Data Members

Name

Description

value

The allocated slot id, or kEntryIDInvalid if unallocated.

Created with MrDocs