LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Functions | Variables
LogCabin::Core::ThreadId::Internal Namespace Reference

Functions

void assign ()
 Pick a unique value to use as the thread identifier for the current thread.

Variables

__thread uint64_t id
 Thread-specific data holds the identifier for each thread.
std::mutex mutex
 Used to serialize access to nextId.
uint64_t nextId
 The next thread identifier that has not already been used.
std::unordered_map< uint64_t,
std::string > 
threadNames
 A map from thread ID to thread name.

Function Documentation

Pick a unique value to use as the thread identifier for the current thread.

This value is saved in the thread-specific variable id.

Definition at line 55 of file ThreadId.cc.


Variable Documentation

Thread-specific data holds the identifier for each thread.

It starts off zero, but is set to a non-zero unique value the first time it is accessed.

Definition at line 31 of file ThreadId.cc.

Used to serialize access to nextId.

Definition at line 36 of file ThreadId.cc.

The next thread identifier that has not already been used.

Definition at line 41 of file ThreadId.cc.

std::unordered_map<uint64_t, std::string> LogCabin::Core::ThreadId::Internal::threadNames

A map from thread ID to thread name.

Not all threads may be present in this map; only those that have had their name set will be found here.

Definition at line 48 of file ThreadId.cc.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines