ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
No Matches
alib::threads::detail Namespace Reference


Details of namespace alib::threads.

Function Index:

ALIB_API ThreadgetThread (std::thread::id c11ID)
void threadStart (Thread *thread)

Variable Index:

ALIB_API std::mutex moduleLock
ALIB_API HashMap< std::thread::id, Thread * > threadMap

Function Details:

◆ getThread()

ALIB_API Thread * getThread ( std::thread::id c11ID)

Retrieves the ALib object associated with the given C++ std::thread::id. In case the threadID is not found in the hash table, the given id is considered a system thread and is entered into the hash table.

c11IDThe native thread id.
The associated ALib thread object.

Definition at line 96 of file thread.cpp.

Here is the call graph for this function:

◆ threadStart()

void threadStart ( Thread * thread)

Internal method to start a thread.

threadThe ALib thread object to start.

Definition at line 89 of file thread.cpp.

Here is the call graph for this function:

Variable Details:

◆ moduleLock

ALIB_API std::mutex moduleLock

The internal mutex used with operations like starting, ending or finding thread objects.

With the presence of module ALib Monomem in the ALib Distribution , this object is not available. Instead, GlobalAllocatorLock is used, because this likewise protects modifications on object detail::threadMap , which uses this allocator.

◆ threadMap

ALIB_API HashMap<std::thread::id, Thread*> threadMap

The hash map used to find the current thread object. The object uses default values for HashTable::BaseLoadFactor and HashTable::MaxLoadFactor . Depending on the use of threads by a using application, these values might be modified prior to starting the first phase of bootstrapping ALib.

If so, an initial call to HashTable::Reserve may be likewise be performed.

With the absence of module ALib Monomem in the ALib Distribution , the type of this object is std::unordered_map.